Maddman0214 Posted July 27, 2010 Share Posted July 27, 2010 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! Quote Link to comment https://forums.phpfreaks.com/topic/208973-sql-file-backup-situation/ Share on other sites More sharing options...
DavidAM Posted July 27, 2010 Share Posted July 27, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/208973-sql-file-backup-situation/#findComment-1091531 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.