News:

Wondering if this will always be free?  See why free is better.

Main Menu

How to use MySQL database on a new/different site?

Started by ButtScratchas, January 29, 2011, 01:23:54 PM

Previous topic - Next topic

ButtScratchas

If I'm understanding this correct, I should be able to use the MySQL database from my old site, which if I understand properly, holds all of my user accounts, forums, boards, bans, etc. Please correct me if I'm wrong, but I should be able to somehow use my old MySQL database on a new, fresh install of 2.0 RC4, and get access to all of my old data. Have I been misinformed?

MySQL Version 5.0.81-community

Help is appreciated, thanks in advance.[/b]

CapadY

It depends on the SMF version of the old forum :)

I'll advise you to install a forum in the same version as your old forum, restore your old database and after that ugrade the old version to the newest SMF version.

An database from a SMF 1.x version can never be used in an SMF 2.x version withouth this way of upgrading.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

ButtScratchas

Quote from: capady on January 29, 2011, 02:36:53 PM
It depends on the SMF version of the old forum :)

I'll advise you to install a forum in the same version as your old forum, restore your old database and after that ugrade the old version to the newest SMF version.

An database from a SMF 1.x version can never be used in an SMF 2.x version withouth this way of upgrading.
The old one was 2.0 RC4, which I have to switch to a new site host, and I'm reinstalling a fresh version with my new domain name, but I want to have my boards/members all here.
How do I restore my old database?
I uploaded the forum software via. FTP, I created a new MySQL database and imported my old one, but when I try to use the database during installation, it tells me I already have SMF installed and it won't let me continue using the database. I assume I'm doing something wrong, lol.

Thanks for the rapid response.

CapadY

In this case,

Copy all your files (I suppose you made a backup) to the new providers server.
After that go via the providers admin panel to PHPMySQL and restore the database.

After that upload "Repair_settings.php" to your forum root and run it.

When everything went fine your forum is running fine with all your messages and so on still there.

The only thing that can give a problem are themes. In that case check the paths in your forum admin panel for the themes.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

ButtScratchas

#4
Quote from: capady on January 29, 2011, 02:56:58 PM
In this case,

Copy all your files (I suppose you made a backup) to the new providers server.
After that go via the providers admin panel to PHPMySQL and restore the database.

After that upload "Repair_settings.php" to your forum root and run it.

When everything went fine your forum is running fine with all your messages and so on still there.

The only thing that can give a problem are themes. In that case check the paths in your forum admin panel for the themes.
The site I was using before was freshly upgraded from 1.1.12 to 2.0 RC4, so everything was still default, no mods, no themes, no nothing.
I've followed the steps you've given me, and I get this error:
Connection Problems

Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

CapadY

Did you run RepairSettings too ?

I suppose the Database settings are wrong.
You can find (and correct) them in the file Settings.php in your forum root.

As a matter of fact I'm not sure if repairsettings will run when the database settings in Settings.php are wrong :)
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

ButtScratchas

Quote from: capady on January 29, 2011, 06:35:04 PM
Did you run RepairSettings too ?

I suppose the Database settings are wrong.
You can find (and correct) them in the file Settings.php in your forum root.

As a matter of fact I'm not sure if repairsettings will run when the database settings in Settings.php are wrong :)
I did run repairsettings, I created a whole new database and imported the database into it, and then changed to said database within the repair_settings.php file, which I accessed properly.

CapadY

#7
You've created a new database, does that mean you did also a complete new install of the forum ? In that case you shouldn't edit the database settings. They should be fine after the install otherwise the install can't be completed.

When you did a fresh install of the forum I think you only have to restore the old database tables without running repairsettings.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

Mareid

#8
I had the exact problem you describe yesterday.  After you restore the database, you must create a database user and password, but the critical step is connecting the user to the correct database.  Go to your mysql databases on cpanel, create the user and password (if not already created), and then add that user and password to the specific database you are using.  You shouldn't  need to use repair_settings, but it's a good check to see if everything is as you expect.  If repair_settings can connect to the database, then your forum should be able to also. 


CapadY

You don't have to make a new table and new user.
Restoring the old database wil also restore all previous members, postings private messages and so on.

Sometimes it's a good idea not to restore some tables. I'm thinking about the logging tables, the package tables and the settings table.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

Mareid

If you are creating a new installation from an existing db the first step is to create a new database and restore from the backup you made.  You will be using install.php to create the front end structure.  During the install process, you need to give the db name and the user attached to the db.  Since this is a new installation, you must have a db user assigned.  This is not restored with the restoration of the database, but is established using Cpanel and mysql databases.  You create a db user and password, then you have to add the user to the database.  Once you do that, when you run install, when it asks you for the database user and password, that's what you put in.

If you have connection problems and  run repair_settings.php and you don't have a username/password for your database, you'll get an informational/error banner at the top of the page that says 'Some settings are not being shown because the MySQL connection information is incorrect.'

CapadY

I still keep saying you allways have to restore the complete member table and never have to try adding the old members to the new table.

When you are gonna add the members from the old database to the new while there are still members in the new table the member ID's won't be the same in the old and the new database. When the member ID's are different all members, named in topics, postings, private messages and so on will be screwed up because they are connected by the member ID.

So, after a fres install, replace the new table completly by the old one.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

Mareid

I think we're talking about two different things.  I am not referring to users of the forum, I'm talking about the internal database administrator, something that must be set up before you can install the forum with the database.  You will not be adding users to the forum database, you're adding a db admin, and you must have that before you can connect the forum db to the forum front end.

Advertisement: