Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Migrating From Snitz - LETS WORK THIS OUT
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Migrating From Snitz - LETS WORK THIS OUT

 Post Reply Post Reply Page  123 12>
Author
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Topic: Migrating From Snitz - LETS WORK THIS OUT
    Posted: 16 September 2005 at 3:45pm

I know a lot of people are wanting to convert from Snitz to WWF, with me being one of them.

We were so close to having a small program to convert everything over from db to db, but MichaelItaly suddenly vanished, and has never returned Cry
 
Because of this, I thought I'd get down and dirty, and try the codes which people have posted, one being a piece which works for most, but not those who have deleted members - created by Satellite.
 
Now if we can put our heads together and work round the problem with deleted members (due to the code not liking missing Autonumber / Author_ID), we'll have a finished product to finally help convert people over!
 
 
 
Starting from where people left off, here's how to convert over, followed by the problem faced with deleted members;
 
 
 
  • Download and install WWF and login as Admin
  • Set up the ranking groups in the Admin panel, for what title / stars people receive for X number of posts, to match those in your Snitz db
  • Open up your WWF db in Access, and import the following tables from your Snitz db, by going to 'File / Get External Data / Import';

forum_category
forum_forum
forum_members
forum_reply
forum_topics

  • Open up 'tblAuthor' and delete the 2 records
  • Compact the db to reset the Autonumber in 'tblAuthor' by going to 'Tools / Database Utilities / Compact and Repair Database...' - this saves you copying the structure and relationships etc
  • Backup the database so you don't have to do the above again!
  • Config and run the following script in a .asp page;

<%
'***************************************************
'     Written by Satellite
'     Give me credit if you modify it and post it elsewhere
'     otherwise your karma will suck and you'll be a moskito
'     in your next life ;)
'
'     Usage: Import the neccesary tables from the snitz database.
'     Set up the groups you want (with the webadministration of WW forums)
'     copy the structure of tblAuthors, delete the old tblAuthors (redo the relations if you want)
'     backup the .mdb file
'     run this file
'     hopefully it has worked =)
'
'     If the script fails.. you need to start with a fresh db, so make a backup copy
'     right before you run the script.
'****************************************************


Response.Buffer = false

Server.ScriptTimeout = 500 'in seconds. many posts means higher number

Set Conn = Server.CreateObject("ADODB.Connection")


Set Conn = Server.CreateObject("ADODB.Connection")
'open database
ProviderName = "Microsoft.Jet.OLEDB.4.0"
DataBaseSource = Server.Mappath("./") & "\wwforum.mdb"
Conn.ConnectionString = "Provider=" & ProviderName & "; Data Source=" & DatabaseSource&";"
Conn.open

Response.Write "Moving all the users...<br>"

SQL = "SELECT M_NAME, M_EMAIL, M_SIG, M_PASSWORD, M_DATE, M_AIM, M_ICQ, M_MSN, M_YAHOO, M_FIRSTNAME, M_LASTNAME, M_LASTHEREDATE, M_DOB, M_OCCUPATION, M_POSTS, MEMBER_ID FROM FORUM_MEMBERS ORDER BY MEMBER_ID ASC"
set rs = conn.execute(SQL)
idValue = rs("MEMBER_ID")

Set rsIns = Server.CreateObject("ADODB.RecordSet")
rsIns.Open "tblAuthor", conn, 1, 2

do until rs.eof
     If(IDvalue = rs("MEMBER_ID")) Then
     rsIns.AddNew
     rsIns.Fields("Username") = rs("M_NAME")
     rsIns.Fields("Author_email") = rs("M_EMAIL")
     rsIns.Fields("Signature") = rs("M_SIG")
     rsIns.Fields("Password") = Left(rs("M_PASSWORD"),50)
     'rsIns.Fields("Date_format") = "dd/mm/yy"
     rsIns.Fields("User_code") = rs("M_NAME") & UCase(Right(Left(rs("M_PASSWORD"),20),12))
     rsIns.Fields("Time_offset") = "+"
     rsIns.Fields("Time_offset_hours") = "0"
     rsIns.Fields("Join_Date") = CDate(createDate(rs("M_Date")))
     rsIns.Fields("MSN") = rs("M_MSN")
     rsIns.Fields("ICQ") = rs("M_ICQ")
     rsIns.Fields("AIM") = rs("M_AIM")
     rsIns.Fields("YAHOO") = rs("M_YAHOO")
     rsIns.Fields("Show_Email") = True
     rsIns.Fields("Real_Name") = rs("M_FIRSTNAME") & " " & rs("M_LASTNAME")
     rsIns.Fields("Last_visit") = CDate(

Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2005 at 6:42pm
so its something to do with this part


do until rs.eof
     If(IDvalue = rs("MEMBER_ID")) Then
     rsIns.AddNew
     rsIns.Fields("Username") = rs("M_NAME")
     rsIns.Fields("Author_email") = rs("M_EMAIL")
     rsIns.Fields("Signature") = rs("M_SIG")
     rsIns.Fields("Password") = Left(rs("M_PASSWORD"),50)
     'rsIns.Fields("Date_format") = "dd/mm/yy"
     rsIns.Fields("User_code") = rs("M_NAME") & UCase(Right(Left(rs("M_PASSWORD"),20),12))
     rsIns.Fields("Time_offset") = "+"
     rsIns.Fields("Time_offset_hours") = "0"
     rsIns.Fields("Join_Date") = CDate(createDate(rs("M_Date")))
     rsIns.Fields("MSN") = rs("M_MSN")
     rsIns.Fields("ICQ") = rs("M_ICQ")
     rsIns.Fields("AIM") = rs("M_AIM")
     rsIns.Fields("YAHOO") = rs("M_YAHOO")
     rsIns.Fields("Show_Email") = True
     rsIns.Fields("Real_Name") = rs("M_FIRSTNAME") & " " & rs("M_LASTNAME")
     rsIns.Fields("Last_visit") = CDate(createdate(rs("M_LASTHEREDATE")))
'     rsIns.Fields("DOB") = CDate(convertDOB(rs("M_DOB")))
     rsIns.Fields("Occupation") = rs("M_OCCUPATION")
     rsIns.Fields("No_of_posts") = rs("M_POSTS")
     SQL = "SELECT Group_ID FROM tblGroup WHERE Minimum_posts <= " & rs("M_POSTS") & " ORDER BY Minimum_posts DESC"
     set rsGroup = conn.execute(SQL)
     rsIns.Fields("Group_ID") = rsGroup("Group_ID")
     rsIns.Update      
     rs.moveNext
     idValue = idValue + 1
else
           rsIns.AddNew
           rsIns.Fields("Username") = idValue
           rsIns.Fields("Password") = idValue
           rsIns.Fields("User_code") = idValue
           SQL = "DELETE * FROM tblAuthor WHERE username = '" & idValue & "'"
           set rsDel = conn.execute(SQL)
           IDValue = IDValue + 1
     End if
     
Loop
set rsGroup = nothing
rsIns.Close


what is on line 72 of the file

can i guess its the part either where you get the group ID (marked in ref above)

OR you are trying to insert a record without a group ID value, just guessing here
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2005 at 3:18am
Ah, I knew I'd forgotten something!
 
Line 72 is highlighted below;
 
 
do until rs.eof
     If(IDvalue = rs("MEMBER_ID")) Then
     rsIns.AddNew
     rsIns.Fields("Username") = rs("M_NAME")
     rsIns.Fields("Author_email") = rs("M_EMAIL")
     rsIns.Fields("Signature") = rs("M_SIG")
     rsIns.Fields("Password") = Left(rs("M_PASSWORD"),50)
     'rsIns.Fields("Date_format") = "dd/mm/yy"
     rsIns.Fields("User_code") = rs("M_NAME") & UCase(Right(Left(rs("M_PASSWORD"),20),12))
     rsIns.Fields("Time_offset") = "+"
     rsIns.Fields("Time_offset_hours") = "0"
     rsIns.Fields("Join_Date") = CDate(createDate(rs("M_Date")))
     rsIns.Fields("MSN") = rs("M_MSN")
     rsIns.Fields("ICQ") = rs("M_ICQ")
     rsIns.Fields("AIM") = rs("M_AIM")
     rsIns.Fields("YAHOO") = rs("M_YAHOO")
     rsIns.Fields("Show_Email") = True
     rsIns.Fields("Real_Name") = rs("M_FIRSTNAME") & " " & rs("M_LASTNAME")
     rsIns.Fields("Last_visit") = CDate(createdate(rs("M_LASTHEREDATE")))
'     rsIns.Fields("DOB") = CDate(convertDOB(rs("M_DOB")))
     rsIns.Fields("Occupation") = rs("M_OCCUPATION")
     rsIns.Fields("No_of_posts") = rs("M_POSTS")
     SQL = "SELECT Group_ID FROM tblGroup WHERE Minimum_posts <= " & rs("M_POSTS") & " ORDER BY Minimum_posts DESC"
     set rsGroup = conn.execute(SQL)
     rsIns.Fields("Group_ID") = rsGroup("Group_ID")
     rsIns.Update      
     rs.moveNext
     idValue = idValue + 1
else
           rsIns.AddNew
           rsIns.Fields("Username") = idValue
           rsIns.Fields("Password") = idValue
           rsIns.Fields("User_code") = idValue
           SQL = "DELETE * FROM tblAuthor WHERE username = '" & idValue & "'"
           set rsDel = conn.execute(SQL)
           IDValue = IDValue + 1
     End if
     
Loop
set rsGroup = nothing
rsIns.Close
 
 
Sorry about that Ouch
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2005 at 12:49pm
iu would say the issue is that you are not adding a input ffor all the required fields

like group_ID, active, email_show etc

they are all required for an input, manually set
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2005 at 1:25pm
Any ideas what would fix that?  I'm not clued up with ASP unfortunately Ouch  I only know the very basics.
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2005 at 3:24pm
each of the below requires a value

rsIns.Fields("Username") = rs("M_NAME")
     rsIns.Fields("Author_email") = rs("M_EMAIL")
     rsIns.Fields("Signature") = rs("M_SIG")
     rsIns.Fields("Password") = Left(rs("M_PASSWORD"),50)
     'rsIns.Fields("Date_format") = "dd/mm/yy"
     rsIns.Fields("User_code") = rs("M_NAME") & UCase(Right(Left(rs("M_PASSWORD"),20),12))
     rsIns.Fields("Time_offset") = "+"
     rsIns.Fields("Time_offset_hours") = "0"
     rsIns.Fields("Join_Date") = CDate(createDate(rs("M_Date")))
     rsIns.Fields("MSN") = rs("M_MSN")
     rsIns.Fields("ICQ") = rs("M_ICQ")
     rsIns.Fields("AIM") = rs("M_AIM")
     rsIns.Fields("YAHOO") = rs("M_YAHOO")
     rsIns.Fields("Show_Email") = True
     rsIns.Fields("Real_Name") = rs("M_FIRSTNAME") & " " & rs("M_LASTNAME")
     rsIns.Fields("Last_visit") = CDate(createdate(rs("M_LASTHEREDATE")))
'     rsIns.Fields("DOB") = CDate(convertDOB(rs("M_DOB")))
     rsIns.Fields("Occupation") = rs("M_OCCUPATION")
     rsIns.Fields("No_of_posts") = rs("M_POSTS")


note the rs(" is copied, you need ot set posts = 0 , show email = 0/false, time offset hours = 0 time offset = "+"

you just need ot make sure that the list for else has the above fields with a value apart from the messengers
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2005 at 5:54am
Sorry, I'm not too sure I understand.
 
I realise that some of fields require something to be input into them, and not left blank.  Do you mean that when it adds a blank record (to replace a deleted member), it needs to add something for all the required fields.  Ie, this part needs a couple more things adding;
 
 
rsIns.AddNew
           rsIns.Fields("Username") = idValue
           rsIns.Fields("Password") = idValue
           rsIns.Fields("User_code") = idValue
           SQL = "DELETE * FROM tblAuthor WHERE username = '" & idValue & "'"
           set rsDel = conn.execute(SQL)
           IDValue = IDValue + 1
     End if
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2005 at 8:20am
that is correct all the felds in my perious post, need to be within the adding section (bit you stated),

as they are required even if its 0,
Back to Top
 Post Reply Post Reply Page  123 12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.