News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

importing existing smf database into new db

Started by barpc, December 01, 2016, 06:54:17 AM

Previous topic - Next topic

barpc

Hi

For technical reasons I lost my smf installation, so I installed a new one V2.0.11, same as the old one and went through the installation pointing at the new blank database.

I then tried importing a .sql.zip backup of the old database biut although it appears to have imported it, when I go to the forum it says there are no members except me(admin) and no messages.

What am I doing wrong?

any help much appreciated for this newbie

llewellyn

Dzonny

Hello there llewellyn,

I moved your topic to the appropriate support board.

Regards your problem, you should use repair_settings.php to link your forum with appropriate, new database that you created and imported old database to. Also make sure that all the paths in repair_settings.php file are correct, and let us know if there's changes on your forum then.

Kindred

did you DROP all tables before doing your import?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

barpc

Thanks for both the answers.
Sorry, I thought my topic had been deleted, soposted it again, justignore the second post, Appologies again

barpc

Hi again

I droped all the tables in the new db and then imported the .sql.zip file again, which it said was successfull

I ran the repair_settings.php ensuring that all of the db info was correct,(coppied and pasted from the "MySQL Database Set Up and Configuration" panel
accepted all of the recommended routes and got the following message.

Some settings are not being shown because the database connection information is incorrect.
Check your database login details, table prefix and that the database actually contains your SMF tables.


At a loss really!!

Still only shows me as the only member of the forum and no historical posts.


Illori

then something you entered was not correct. if you are not sure what the database connection details are ask your host for help.

Dzonny

I suppose you used different prefix for tables in original database and in the "clean" one.
Also, can you tell us how did you made a backup file for your database?

richardwbb

You also might want to open the zip, open the file inside with a text editor [might take a while, don't use Notepad, if you don't have a text editor, get Notepad++]

Then find '`smf_messages`', it will at the second hit; [omit the ''' and keep the '`']

--
-- Dumping data for table `smf_messages`
--


And verify if your messages are there.

If you can't find anything, then, Dzonny is correct, and do a find in that file for '_messages`'

And I make up from your words that you don't have the contents of the old Settings.php, so you must verify if your language is displayed correct, but you can worry about that later. [there was a question shown with the installation of SMF, if you require UTF-8 or not. And this setting must be the same as on your old forum. Then it'll be right for 99% sure.

Good luck.
If my post in this topic looks ambiguous to you, then I'm with Murphy's law and General Stupidity. In other words, trial and error.

barpc

Would like to reply to all those who posted on my topic.

Illori -  Well I did the repair php and it came back with
Your settings were saved. Please confirm all the paths and URLs below, and that your forum works.
Make sure you remove this file!


Dzonny - I used the same prefix smf_ on the old and new Dbs

Dzonny - I backed up the old database from PHPMyAdmin using the "Quick - display only the minimal options"

richardwbb - I have just found an archive copy of the settings.php from October, what do I do with it?

richardwbb - Could not find '`smf_messages`'



Dzonny

Can you please tell us if database on your "old" forum (before you made a backup) and a new database that you used for your forum installation have the same name? If you used import in phpMyAdmin it may be that new database is created with original db name found in your sql file.

The best would be to login to your phpMyAdmin and look through all your databases, and detect the "old" one (with a lot of tables, messages etc) and a "new" one - which will be a lot smaller in a terms of size. Then you can easily "link" your forum with the appropriate database via repair_settings.php, hope that it makes sense.

richardwbb

First q;
Compare that file with the one that has been created with repair_settings.php. You shouldn't be editing Settings.php manually, and with the correct usage of repair_settings.php, [you might have to type something]; only one difference;

the '$db_character_set = 'utf8';'. If the old file holds it, you probably will want to put that in the new Settings.php that belongs to the new installation of your SMF forum.

If that utf8 settings, isn't in the old Settings.php, then you should give the new forum a try without that setting and check your forum with special characters, that aren't in the Latin1 character set and that are used often in your language. But that is what I meant with 'but you can worry about that later.' Please re-read my previous post.

Second q;
I wrote in my previous post; 'do a find in that file for '_messages`'. If you missed that, n.p. If I wrote something unclear, say so. If you do not follow, what I wrote, say so. If question arise regarding encoding/ proper [or what Latin1 is for example] display of the database, tell us.

Quote from: barpc on December 02, 2016, 03:05:04 PM
richardwbb - I have just found an archive copy of the settings.php from October, what do I do with it?

richardwbb - Could not find '`smf_messages`'
If my post in this topic looks ambiguous to you, then I'm with Murphy's law and General Stupidity. In other words, trial and error.

barpc

Quote from: Dzonny on December 01, 2016, 07:00:28 AM
Hello there llewellyn,

I moved your topic to the appropriate support board.

Regards your problem, you should use repair_settings.php to link your forum with appropriate, new database that you created and imported old database to. Also make sure that all the paths in repair_settings.php file are correct, and let us know if there's changes on your forum then.

I have run repair_settings.php and it came back with the following :-
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /homepages/6/d671793237/htdocs/barpc/forum/Sources/Subs-Db-mysql.php:58 Stack trace: #0 /homepages/6/d671793237/htdocs/barpc/forum/repair_settings.php(362): smf_db_initiate('db671798225.db....', 'db671798225', 'dbo671798225', 'd101284x', 'smf_1', Array) #1 /homepages/6/d671793237/htdocs/barpc/forum/repair_settings.php(20): initialize_inputs() #2 {main} thrown in /homepages/6/d671793237/htdocs/barpc/forum/Sources/Subs-Db-mysql.php on line 58

I really just need to know which files contain the database information, so I can go in and change the details to the new Db.

Thanks

Shambles

Quote from: barpc
I have run repair_settings.php and it came back with the following :-
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in

Looks like your server is set to deliver PHP7. Try to get it set to PHP5.6 via your cPanel, or ask your host if you don't have such an option.

Quotewhich files contain the database information
forum root > Settings.php

Advertisement: