Moving Your Forum To A New Server - Step By Step Guide

Started by Goshdarnit, January 19, 2008, 05:04:46 AM

Previous topic - Next topic

Goshdarnit

Hi all. I recently moved my site to a new server, and found it difficult to locate a single resource that told me exactly how to do it. I have seen various suggestions and alternatives, but this is the only one that worked for me. I could not simply copy my site across to the new server, upload my database and run repair_settings.php on it. This didn't work for some reason. So, here goes. Every stage, blow by blow.

Before starting, I put my forum into Maintenance Mode (Server Settings in the Admin section) to avoid losing new accounts or posts created after the backup. I changed the Maintenance Mode message to tell my members what was happening. Then I backed up my mySQL database, including table structure AND the table data (this can be done from the Admin section of your SMF forum, under Forum maintenance. Note that I ended up using the uncompressed .sql file. I also downloaded bigdump.php and repair_settings.php, as well as the full install package of SMF (I wanted to use Webinstall, but it would not work on my site). I was not initially sure that I needed bigdump, but it turned out that I did. Finally, unpack the installation package into a directory on your computer.

OK, preparations done, time to start setting up on the new server. First of all, you need to set up an SQL Database on your hosting account. Then load bigdump.php with Notepad and change the settings for the mySQL server location, database name, username and password in the relevant sections of the text file. This is possibly the most tricky part as you have to find those sections in that text file. They are near the start. On my screen, with word wrap on, they were about 12 lines down. The texts to looks for are "$db_server", "$db_name", "$db_username" and "$db_password". Insert the relevant values between the quote marks after each one of those words. You will get those figures from your hosting company when you set up your SQL database.

Now load up your ftp program and log in to your ftp server for your OLD site (on the server you are moving FROM). Go to the directory containing your forum and download the whole lot to your hard drive. Go make a cup of tea. Beer will come later. Stay sober for now!

After that is done, log into the FTP server on your NEW site (the one you are moving TO). Create the directory that you want your forum to install to (I just put it in the root directory, as the forum is all that sits on my server). Then ftp all the files from the INSTALLATION PACKAGE (you are not going to upload your own forum yet) onto the new server. Make another cup of tea. Don't worry, beer is coming later. Then go to "www.yourdomain.com/install.php" and follow the steps to install a clean copy of SMF.

Then create a directory called "Dump" in the root directory of your site. The name is not important, you can call it anything. I found dump amusing though. Then ftp bigdump.php (even more amusing!) into the Dump directory. Then ftp the .sql file which is the backup of the database for your old forum which you downloaded right at the start into the Dump directory also. Now open your web browser and go to "www.yourdomain.com/Dump/bigdump.php" and click on "Start Import" next to the sql file that you just uploaded. This will install all the database items for your forum. Wait for bigdump to finish its business (sorry, weak toilet humour there).

Next, go back to your ftp programme and upload the copy of your forum from the old server. Yep. Time for another cup of tea. By this time you will also probably find a toilet trip useful. Maybe even a bigdump.

When that has completed, ftp a copy of repair_settings.php into the root directory for your forum (the one with index.php in it). Now go to "www.yourdomain.com/repair_settings.php". Type in all the correct details for your new host server. Many will give you suggestions which are usually correct. On mine, the suggested value of "localhost" for the mySQL server was wrong, but all the other suggested vales were correct. Make a note of the correct value for "Forum Directory" - you may need it later. Click on "Repair Settings". And that should be it. Your forum should now function. You may find that after you do this, a whole list of new directories appears on the list at the bottom. If so, set them to the correct values also and then click on Repair Settings a second time.

Now access your forum, and log on with your admin account. Look through the forum and see if everything is normal. Is the theme as it should be? Are all the posts correct, with the correct smileys and attachments showing? If so, then you are done, and you can take your forum out of Maintenenance Mode. If any of the above are wrong, you need to fix them. It's easy enough. Go to the Admin section of your forum. If your smileys are not showing on people's posts, click on "Smileys and Message Icons" on the left hand side. Make sure the correct URL is in the Base URL to all Smiley paths box. If you installed to the root directory, it will probably be "http://www.yourdomain.com/Smileys". In the absolute path to all Smiley sets box, copy the Forum Directory route that you copied from Repair Settings above and add "/Smileys". Click on "Save Changes". If people's attachments and avatars are not showing, click on "Attachments and Avatars" on the left side of the Admin screen.  In the attachments directory box copy the Forum Directory route from Repair settings and add "/attachments" to the end of it. Click on "Save". Finally, go to Themes and Settings on the left hand Admin menu. Click on the "Themes and Settings" tab at the top of the page which loads. At the bottom of this screen, in the Base Path to Themes Directory box, type in the URL for your forum, followed by "/Themes" (on mine, www.yourdomain.com/Themes). In the box below this, copy the Forum Directory route from Repair Settings and add "/Themes". Click on "Attempt to reset all themes". All the themes on your list should now change to show the correct dircetory. If you have themes which are not installed in the Themes directory you will have to manually alter them on an individual basis.

You may not have to do this last section. I did, but I think I missed some of the extra settings which appeared in Repair Settings after I ran it the first time.

You should now find that you have a complete replica of your forum running on your new server. If all is well, take it out of Maintenance Mode and get posting!

This is quite longwinded, but I tried the shortcuts that other people have suggested and none of them worked for me. This method, while long, seems to be a surefire way of getting it to work.

Good luck!

Oh yes.

One final stage.

I did promise.

Open a beer and drink it. You have earned it.

Pip2andahalf

I just wanted to say thanks for this excellent guide to moving your forum!

I appreciate your time that you took to write this up!

Cheers!

minicivan

Hello guys, i have to ask, if anyone did that and it works, tell me, this step when i have to upload my old forum, do i have to overwrite files or not?

Thanks,
Ivan

greyknight17

Hi Ivan and welcome to SMF.

If you are moving to another host and have all your old forum files, there is no need to overwrite anything on the new host. Your old files will be the "current" one once you go live :)

minicivan

Yeah, i noticed, when i was installed new foum on new host, and just updated it with bigdump.php i can see all my posts, i have now another problem, when ppl with 17" monitors run forum he is to big for screen, i didnt saw that because i have 19". Can you tell me please how to optimize forum for them users, a lot ppl have 17" screen... Thank you.



tethead

question, using BigDump, did you encounter an out of memory error?  i have tried increasing my memory limits (in php.ini ) but to no avail.  basically, i get this error (with whatever my current memory limit is set to):

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32768213 bytes) in /var/www/forums/dump/bigdump.php on line 530

i have increased that limit all the way up to 512 MB, it says the same thing.  now, the file i am trying to import is over 300 MB compressed (over 1.2 GB un-zipped).

reading on BigDump's website, they say:

Q: I get an error: "Fatal error: Allowed memory size of xxx bytes exhausted" or "MySQL server has gone away". Why?
A: Your dump file probably contains extended inserts. An extended insert contains all table entries within one SQL query. BigDump isn't able to split such SQL queries. Please turn off extended inserts when exporting database from phpMyAdmin


So, do SMF's dbs contain extended inserts, and maybe this is why it won't work?  Or am I missing something obvious...

Please help, i am desperate to restore my forums after a hard drive crash.

Just to note, this is on a Debian (Etch) server, with SMF software 1.1.4.  I do not have a .sql backup of my database - instead, i have just the .MYD/.MYI/.frm files, which are normally stored in /var/lib/mysql/smf/


week4paug.net - a website for all things PHiSH

greyknight17

You already created a new topic here. You should post any updates/followups on that topic instead. Did you try copying the files over to the new drive yet? Please reply back to the other topic and not here....

No.Body


Nice work mate. Thanks!


*** Posting for reference ***  :)

barnepal

Hi,

I recently accidently deleted my forum. Luckily for me I had made a complete .sql backup the night before.  I decided to follow the tutorial posted but ended up getting errors.

The old forum was located at www.mydomain.com/forum and I tried to restore the forum at www.mydomain.com/board. On the old forum, an upgrade was made from smf 1.1.3 to 1.1.4 before I saved the 'complete .sql'. This time round I did a fresh installation of smf 1.1.4. I uploaded the 'complete .sql' via FTP into the same directory as the bigdump.php file. The following error showed when I selected 'start import':


Error at the line 3284: (1, 1500, 'BY', 2, 1499, 0);

Query: (1, 1403, NULL, 3, 1402, 1),
(1, 1404, '<topic>', 2, 1403, 0),
(1, 1405, NULL, 3, 1404, 1),
(1, 1406, '', 2, 1405, 0),
(1, 1407, 'HIS', 2, 1343, 0),
(1, 1408, 'GOAL', 2, 1407, 1),
(1, 1409, '<that>', 2, 1408, 0),
(1, 1410, NULL, 3, 1409, 1),
(1, 1411, '<topic>', 2, 1410, 0),
(1, 1412, NULL, 3, 1411, 1),
(1, 1413, '', 2, 1412, 0),
(1, 1414, 'NAME', 2, 1407, 1),
(1, 1415, '<that>', 2, 1414, 0),
(1, 1416, NULL, 3, 1415, 1),
(1, 1417, '<topic>', 2, 1416, 0),
(1, 1418, NULL, 3, 1417, 1),
(1, 1419, '', 2, 1418, 0),
(1, 1420, 'WHEN', 2, 1, 0),
(1, 1421, 'DID', 2, 1420, 0),
(1, 1422, 'DR', 2, 1421, 0),
(1, 1423, 'RICHARD', 2, 1422, 0),
(1, 1424, NULL, 3, 1423, 1),
(1, 1425, '<that>', 2, 1424, 0),
(1, 1426, NULL, 3, 1425, 1),
(1, 1427, '<topic>', 2, 1426, 0),
(1, 1428, NULL, 3, 1427, 1),
(1, 1429, '', 2, 1428, 0),
(1, 1430, 'WALLACE', 2, 1422, 0),
(1, 1431, 'CREATE', 2, 1430, 0),
(1, 1432, NULL, 3, 1431, 1),
(1, 1433, '<that>', 2, 1432, 0),
(1, 1434, NULL, 3, 1433, 1),
(1, 1435, '<topic>', 2, 1434, 0),
(1, 1436, NULL, 3, 1435, 1),
(1, 1437, '', 2, 1436, 0),
(1, 1438, 'IS', 2, 1420, 0),
(1, 1439, 'DR', 2, 1438, 0),
(1, 1440, 'WALLACE', 2, 1439, 0),
(1, 1441, NULL, 3, 1440, 1),
(1, 1442, '<that>', 2, 1441, 0),
(1, 1443, NULL, 3, 1442, 1),
(1, 1444, '<topic>', 2, 1443, 0),
(1, 1445, NULL, 3, 1444, 1),
(1, 1446, '', 2, 1445, 0),
(1, 1447, 'WHERE', 2, 1, 0),
(1, 1448, 'CAN', 2, 1447, 0),
(1, 1449, 'I', 2, 1448, 0),
(1, 1450, 'FIND', 2, 1449, 0),
(1, 1451, NULL, 3, 1450, 0),
(1, 1452, 'WALLACE', 2, 1451, 1),
(1, 1453, '<that>', 2, 1452, 0),
(1, 1454, NULL, 3, 1453, 1),
(1, 1455, '<topic>', 2, 1454, 0),
(1, 1456, NULL, 3, 1455, 1),
(1, 1457, '', 2, 1456, 0),
(1, 1458, 'DR', 2, 1450, 0),
(1, 1459, 'WALLACE', 2, 1458, 1),
(1, 1460, '<that>', 2, 1459, 0),
(1, 1461, NULL, 3, 1460, 1),
(1, 1462, '<topic>', 2, 1461, 0),
(1, 1463, NULL, 3, 1462, 1),
(1, 1464, '', 2, 1463, 0),
(1, 1465, 'REACH', 2, 1449, 0),
(1, 1466, 'DR', 2, 1465, 0),
(1, 1467, 'WALLACE', 2, 1466, 1),
(1, 1468, '<that>', 2, 1467, 0),
(1, 1469, NULL, 3, 1468, 1),
(1, 1470, '<topic>', 2, 1469, 0),
(1, 1471, NULL, 3, 1470, 1),
(1, 1472, '', 2, 1471, 0),
(1, 1473, 'DOES', 2, 1447, 0),
(1, 1474, 'DR', 2, 1473, 0),
(1, 1475, 'WALLACE', 2, 1474, 0),
(1, 1476, NULL, 3, 1475, 1),
(1, 1477, '<that>', 2, 1476, 0),
(1, 1478, NULL, 3, 1477, 1),
(1, 1479, '<topic>', 2, 1478, 0),
(1, 1480, NULL, 3, 1479, 1),
(1, 1481, '', 2, 1480, 0),
(1, 1482, 'LIVE', 2, 1475, 1),
(1, 1483, '<that>', 2, 1482, 0),
(1, 1484, NULL, 3, 1483, 1),
(1, 1485, '<topic>', 2, 1484, 0),
(1, 1486, NULL, 3, 1485, 1),
(1, 1487, '', 2, 1486, 0),
(1, 1488, 'WORK', 2, 1475, 1),
(1, 1489, '<that>', 2, 1488, 0),
(1, 1490, NULL, 3, 1489, 1),
(1, 1491, '<topic>', 2, 1490, 0),
(1, 1492, NULL, 3, 1491, 1),
(1, 1493, '', 2, 1492, 0),
(1, 1494, 'HE', 2, 1473, 0),
(1, 1495, 'LIVE', 2, 1494, 0),
(1, 1496, '<that>', 2, 1495, 0),
(1, 1497, 'I', 2, 1496, 0),
(1, 1498, 'WAS', 2, 1497, 0),
(1, 1499, 'CREATED', 2, 1498, 0),
(1, 1500, 'BY', 2, 1499, 0);

MySQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1, 1403, NULL, 3, 1402, 1), (1, 1404, '', 2, 1403, 0),



The size of the complete .sql is around 10MB. Because of this I can't upload it through phpmyadmin as the maximum file size I can upload is 5MB. I also tried the restore_backup.php but it seemed to timeout after an hour.

Can anyone advice me on what to do?

Sharing Lights

What is the feature or a software if known which allows to copy
not whole Forum but Threads/Posts at once to another Forum under the same avatar.


Another word: I 'd like to copy my Posts from another Forum to my, new Forum in bulk "as-is".
Sacred Triangle: Believe/Learn/Accomplish.

Foundation: is the Virtues.
Result: re-discover your, Higher Self connecting
- Above & Below -Past & Future
Fulfilling Your Destiny!

- Sovereignty, Strength, & Tolerance

In order to preserve accuracy,
my writing(s) may be re-posted unedited
& in context only!

http://sovereignjustice.org
All Rights & Liberties Reserved Without Prejudice

Advertisement: