Jump to content

Recommended Posts

Hello, I'm in desperate need of help. Some posts were lost on my vBulletin forum and I have a backup from a month ago. I got the backup and extracted the .sql file. The problem is now, I want to update the posts and threads tables without replacing the entire .sql file.

 

I need some way of using php to connect to the .sql file and then update the tables on the real database. Any help would be appreciated! Thanks!

Link to comment
https://forums.phpfreaks.com/topic/208973-sql-file-backup-situation/
Share on other sites

Create a new database named "restoreData" or something.

Change the database name in the .SQL file (to this new database name)

Load the .SQL file so it goes into the new database.

 

Run queries to update the data from one database to the other.  For instance:

 

INSERT INTO newDatabase.tableName SELECT * FROM oldDatabase.tableName WHERE ID = missingIDvalue;

 

will let you copy data from one to the other.

 

HOWEVER -- I do NOT know the database structure and table structures and cannot advise as to which rows/tables need to be moved.  If you are not careful, you will clobber the current database.

 

I would highly -- VERY HIGHLY -- recommend, creating a COPY of the current database on a development platform, then test your update process against it. Then test the application against the updated database, thouroughly. When you are satisfied that it works, and ALL vBulletin checks come up clean, then BACK UP THE FUNCTIONING DATABASE and run your entire process against it.  You will want to lock out the users while you are updating the database if possible (at least I would want to).

 

Edit: NEVER - EVER even THINK of running a database cleanup/fixup without FIRST TESTING THOUROUGHLY and BACKING UP the working database.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.