Advertisement:

Author Topic: [Tutorial] ''How to backup&restore your forum in several different ways''  (Read 105442 times)

babjusi

  • Guest
Recently I have come across some posts where people had problems with restoring their backup. So I decided to make a tutorial on the subject, maybe someone will find it useful. If the moderators think that this tutorial is not necessary or not in the right place, then feel free to delete it or remove it.

Backing up your forum

A lot of web service providers say they do backup of all the files, but my opinion is not to take their word for granted. We have put in a lot of efforts and time in creating our forums,so if we lost them, then all our hard work would have been in vain. Backing up our forums at least once a week, makes sure that we never loose too much of our work in case of a server crash, and it will make us sleep better at night.  ;) It is easy and fast, so there is no reason for not doing it.

The way I see it we can make a backup in several different ways.

1.Through ''Forum Maintenance'' in the Admin Panel


When backing up this way it is better to do one backup with the ''the table structure'' option checked and another one without. So if later on,you will be restoring to a database in which the tables are already built, you can use the backup copy ''without the table structure'' and the other way around.

2.Through phpmyadmin at the Control Panel of your host

Open phpMyAdmin.
1. Click Export in the Menu to get to where you can backup you MySql database.
2. Make sure that you have selected to export your entire database, and not just one table. There should be as many tables in the export list as showing under the database name.
3. Select"SQL"-> for output format, Check "Structure" and "Add AUTO_INCREMENT" value. Check "Enclose table and field name with backquotes". Check "DATA", check use "hexadecimal for binary field". Export type set to "INSERT".
4. Check "Save as file", do not change the file name, use compression if you want. Then click "GO" to download the backup file.

Note If you have large databases it may be not possible to backup using phpMyAdmin, as phpMyAdmin has some file size limits. So, in this case you will  to use the command line tools that comes with Mysql. I came across this method recently and I am currently testing it. So, use it at your own risk

1. Change your directory to the directory you want to dump things to:

user@linux:~> cd files/blog

2. Use mysqldump (man mysqldump is available):

user@linux:~/files/blog> mysqldump --add-drop-table -h mysqlhostserver
 -u mysqlusername -p databasename (tablename tablename tablename) | bzip2
 -c > blog.bak.sql.bz2

Enter password: (enter your mysql password)
user@linux~/files/blog>

Example:
mysqldump --add-drop-table -h db01.example.net -u dbocodex -p dbwp | bzip2 -c > blog.bak.sql.bz2

Enter password: my-password
user@linux~/files/blog>

The bzip2 -c after the pipe | means the backup is compressed on the fly.

Note: Compressing db's on the fly is only appropriate for small forums. -For large forums its best to compress after the dump due to it loading everything in memory when done on the fly.

Thanks to Tony for bringing this to my attention and reminding me to include it



3. The third method of making a backup is to use the create_backup.php tool created by Unknown, which you will find it attached at this post

Upload the create_backup.php tool to the same directory where your smf files are,point your browser to it and follow the instructions.

 i.e. www.yoursite.com/forum/create_backup.php

Note that ''forum'' stands for the directory where your smf files are located. If your smf files are located to same other directory, then replace ''forum'' while pointing your browser with the name of that directory.
Or if your smf files are in the root directory, then point your browser to:
www.yoursite.com/create_backup.php


3. Through SSH/Telnet

This will only work if you have SSH or Telnet access to your site. You will have to ask your hosting company about that. If you do, the next thing you will need is a SSH/Telnet Client. I would recommend PuTTy.

Open your SSH/Telnet client and log into your website. This will bring you to the FTP root folder. To create a backup in the current directory, type in the following:

Code: [Select]
mysqldump --opt -Q -u dbusername -p databasename > backupname.sql
If you want to create the backup in a separate directory, then instead type in:

Code: [Select]
mysqldump --opt -Q -u dbusername -p databasename > /path/to/backupname.sql
The program will ask you for your database password. Enter it and the backup process of your database will start.

Some hosting companies, stores the db in a remote server, in that case you will need to add the server name to the command line. You can see that at the file that holds the db info. It varies for forums.
The command line for the current directory will be:

Code: [Select]
mysqldump --opt -Q -h servername -u dbusername -p databasename > backupname.sql
Whereas for the separate directory it will be:

Code: [Select]
mysqldump --opt -Q -h servername -u dbusername -p databasename > /path/to/backupname.sql


4.Through mysqldumper

You can download it and read how to use it at its official website:

http://www.mysqldumper.de/en/

Mysqldumper can be used to restore the database as well


5. Using Java Backup Tool (Windows). I have never used this method, so I can not comment on its efficensy


Restoring the database

1. Through phpmyadmin at the Control Panel of your host


Open phpMyAdmin.
1. Click Import in the Menu.
2. Choose Location of the text file.
3.Browse to your backup of the database that you have stored in your computer
4. Choose Character and Format of imported file
5. Click Go


Restore without phpMyAdmin

The restore process consists of unarchiving your archived database dump, and importing it into your Mysql database.

Assuming your backup is a .bz2 file, creating using instructions similar to those given for Backing up your database using Mysql commands, the following steps will guide you through restoring your database :

1. Unzip your .bz2 file:

user@linux:~/files/blog> bzip2 -d blog.bak.sql.bz2

Note: If your database backup was a .tar.gz called blog.bak.sql.tar.gz file, then,

tar zxvf blog.bak.sql.tar.gz

is the command that should be used instead of the above.

2. Put the backed-up sql back into mysql:

user@linux:~/files/blog> mysql -h mysqlhostserver -u mysqlusername
 -p databasename < blog.bak.sql

Enter password: (enter your mysql password)
user@linux~/files/blog:>

Now, as we mentioned above, phpMyAdmin has some file size limits so if you have large databases it may not be possible to backup using phpMyAdmin. In that case we can restore the backup in 2 other different ways, which are as follow:


1.Restore_backup.php tool created by Unknown, which can be found attached this post

Upload the restore_backup.php tool to the same directory where your smf files are,point your browser to it and follow the instructions.

 i.e. www.yoursite.com/forum/restore_backup.php

Note that ''forum'' stands for the directory where your smf files are located. If your smf files are located to same other directory, then replace ''forum'' while pointing your browser with the name of that directory.
Or if your smf files are in the root directory, then point your browser to:
www.yoursite.com/restore_backup.php


3. Through SSH/Telnet

If you have access to SSh, then you can use putty or some other SSH/Telnet Client that takes your fancy.

First upload your backup copy to your server and then open your telnet client and log in to your site type in directly the path to where your backup is located in your server. So the command line will be something like this:

Code: [Select]
mysql -u dbusername -p databasename < /path/to/backupname.sql
and enter the db password.

Don''t forget that if you are on a remote MySQL server, then don''t forget to add the server name to the command line. Like this:

Code: [Select]
mysql -h servername -u dbusername -p databasename < /path/to/backupname.sql
4. The other way is through BigDump: Staggered MySQL Dump Importer
 



5. Through mysqldumper

You can download it and read how to use it at its official website:

http://www.mysqldumper.de/en/

Mysqldumper can be used to backup the database as well




I hope that this tutorial may come in handy to someone.

Best regards
Babjusi

« Last Edit: September 10, 2008, 04:41:45 PM by babjusi »

Offline Smith6612

  • Full Member
  • ***
  • Posts: 406
    • My Website
Nice Tutorial. It'll be useful for a lot of people I'm sure. But one question: Will this tutorial be able to help me on a server that has a crashed forum/has no phpMyAdmin, but is a standard Windows Command Line for MySQL? That's how my server is. On my server, I can just navigate to the MySQL install path (C:\Program Files\MySQL\ ) and then I copy and paste the data folder to my backup location on my network (after shutting down the MySQL and Web Server :) ). That's basically how I back up my databases.

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
@Smith6612: The code mentioned earlier (see below) should do the job for you. You have to make sure that mysql is in the PATH environment in Windows or cd (change directory) to the MySQL\bin folder (I think that's where it's located). Then run the code...

Code: [Select]
mysql -h mysqlhostserver -u mysqlusername -p databasename < blog.bak.sql
If you want to backup the database, see the tutorial above again for the command line...

Offline Smith6612

  • Full Member
  • ***
  • Posts: 406
    • My Website
Oh, ok... thanks for that info.

babjusi

  • Guest
But note, that that method is still being tested.

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
That method should work. The code looks right and I have tested this before on my local machine with SQL running. Imported without a hiccup :)

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm batman
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Owwiee Superb! :P
That Java Backup way is very good to I use it.

Offline shadow82x

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,279
  • Gender: Male
    • cmblaber on LinkedIn
Super detailed babjusi! :) I will show people this topic when importing a database. Superb job.
Colin B
Former Spammer, Customize, & Support Team Member

Offline cursed

  • Semi-Newbie
  • *
  • Posts: 23
suppose i am moving to a new host. do i have to move the files and folders to my new host too? My old forum was in: www.mysite.com/forum [nofollow]

If i want to make the appear the forum in www.mysite.com [nofollow]
do i have to move the files to main directory?

babjusi

  • Guest
suppose i am moving to a new host. do i have to move the files and folders to my new host too? My old forum was in: www.mysite.com/forum

If i want to make the appear the forum in www.mysite.com
do i have to move the files to main directory?

If you want to move your board to a new host, you can do so in 2 ways.

1. You can upload the forum files with your ftp client, to your pc and then re-upload them to your new host in the root directory and then run repair_settings.php to set straight all the paths, urls and the other settings. To do that you must click on the blue recommended values.

2. Or you can install first smf in the root directory of your host, then import the database and run the repair_settings.php for the reasons mentioned above. But in this way you willl have to re-install all the mods from the begin.

For more info of how to move the board you can check out the on-line manual

How do I move my SMF board to a different host?
« Last Edit: August 22, 2007, 05:03:32 AM by babjusi »

Offline cursed

  • Semi-Newbie
  • *
  • Posts: 23
thax for the quick reply :)

babjusi

  • Guest
thax for the quick reply :)

No problem

Offline cursed

  • Semi-Newbie
  • *
  • Posts: 23
Can u gimme a details about how i import the sql in phpmadmin. :D

Offline cursed

  • Semi-Newbie
  • *
  • Posts: 23
Found It. sorry

Dumb me :(

babjusi

  • Guest
Found It. sorry

Dumb me :(

No problem. Were you able to import the db?

Offline cursed

  • Semi-Newbie
  • *
  • Posts: 23
I am Having this Problem:

MySQL said:
#1064 - 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 'PK' at line 1

:( Any help?

Offline cursed

  • Semi-Newbie
  • *
  • Posts: 23
And here is the details of the error:

There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below:

----BEGIN CUT----
eNo9VXlUUnkbbibnM82TY4u2qcypxpoEx5XU4yErs3KrzDQXGC1FP1lMFHdoGbOyok3NUGm3QjQj
IEWgqdApIkpzQVJGTUkQERGQ/fOrw5x7/7jnvs/7vs/zvs/93bCDB2MOBgF2egN2+gAiw6KDAD4A
X4CPd6C3feyhhcBie/udh2ODABv3HgsCYI4jclJzMem5IERWGignM8cTC/AB+QYAfH7/3d/r920L
98JjkI9PkLc3AJGODASEFeYANtpHFcUeiAwC+IG8Qd7ewF3paVmpKJgfJjUXng4GItBw+7jYg4CY
WE9AaHhY9CFPwOGwhc7xWShAVEzi3sjIUIA/6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Vo8Mh0zWkO++JyF51Y+m1vK7OeNv6JVqc5LEhoLy0
uB3vaedaHhV1qfflpyqQjS3GcuO7BBxpnx97g6LLtS3T6Ez7eVObgjw238HlcSusFnDV+KyuDCrj
pJwcvRe5diXlNOFFiDUWy3xX5bb7bsIDRey5Rtn4nY2jdg8f/7Hp5UO9S+J/5/54N/Yo6l/dJwuD
snNL9E5+4RL1Rwhjjdp7dc+pRsWKosm7atUGvCvX/nxO4Nse0MrHjD2vkjY7DSeVK1Zcl7TwsQwc
4/YJv2k6pviX3iqojWEAk2O0Vq1KwN2Xve0y75NFXwr8qv3yGEKvTPr09oFC+/DFg9iTT8CbDi7y
DvLYMR8Km9xZ+nFrj/aR/fa+K2I1WbSdur4hKsb+f3L5U4g=
----END CUT----
----BEGIN RAW----

ERROR: C1 C2 LEN: 2 3 2191
STR: 

CVS: $Id: sqlparser.lib.php,v 2.36 2005/08/08 20:22:11 lem9 Exp $
MySQL: 4.1.11-Debian_4sarge7-log
USR OS, AGENT, VER: Win MOZILLA 5.0
PMA: 2.6.4-pl2
PHP VER,OS: 4.4.4-8+etch1 Linux
LANG: en-utf-8
SQL: PK����]7���}���&gt;����comics_slayer.sql�ms7�5�}~E�K9B� ��xg��X[���ǖg�DL�\�]-�ds�M{����BU��#w#�sE�/����|�lv����ϗ��ُ��ً���?&lt;{6��^�7g3~������~�;������oǭ��ڋ�5;�G��כ��g����Y4g�f+��bs���Us�l�/���������Og��̬���fϿ���ٶMH���LW�"4���5�Z�cV=�&lt;��E����E[��m����ۋ��C��9|�{���Tśz~��.v����r��V��l~�����m���*���߼��y��o^�=��l���?�}����i�\_�(���f�g�wg�r��7��?}�ͬ��mޮ�ϳ�S/���/���gv�?w�G�߾���ߴ��?��?�������m�W����k�������\6���d7;���g������ɉ�����7��\6�D�z�Dv�M���9�/v�N�Ua���6���o�I��
Ԭ��fu^��~k����^�YAB�f�[Ӝ-�]�n�]7��e;������rۜM���W�&gt;����z����I��������_�z��O�~x���og�z���W�۹�m;���g/^���O߼�}���~|��O'-������' ϩ�w�e�Mw�ū�?�������7ߍ��Ͽ��右'���������f{q���?.���n��p������&lt;���_����7������?��8{�ټ;i���.N�-���4k�|~9Ƭ��)���V9�����������_�7^-�?���_���]-��?u�Y�oy�o���i��7?�x_��5'����؜l���ٶ�?�e��c��G��n�H�2�t�&lt;��[?�5|H��[?t��Z\��k��\�]5�_;.⧶�?��|��g�����ǡ�?&lt;8��S���v���-�~��K~��p�\/����   �����A�Z��4����.�������&gt;��c-�o/�];��ݻ�����v�K�k�&gt;�lnYD�qF_�Q}v�9n'�ɴp�g�ݮ^���=x�&gt;�|����7o����3O���hɴro����?�'v��[�o�
�x��_��u]r��v�Ee��b��j}Ҝէw�������og'��&��KE~GŮ͐A3&gt;�����������&lt;���L�a?�Oҿ^��� u5u��17n���1Z�[J�$v&lt;��߾~���f����bw����Zfe����   tZ齈���vM��۷Z�����J�M`µߵ��M.\

Offline DadL

  • Jr. Member
  • **
  • Posts: 231
Quote
1.Through ''Forum Maintenance'' in the Admin Panel

When backing up this way it is better to do one backup with the ''the table structure'' option checked and another one without. So if later on,you will be restoring to a database in which the tables are already built, you can use the backup copy ''without the table structure'' and the other way around.

Just to make sure... is it like this?


babjusi

  • Guest
@cursed, how are you trying to restore your backup file, zipped? If so unzip it and try to restore it as a sql. format and see if that would help

@DadL, the way shown at the screen shot is with the ''the table structure'' option checked.

Offline cursed

  • Semi-Newbie
  • *
  • Posts: 23
Thax guys for reply. ;D

But ive solved my problems. [nofollow]

Offline ApplianceJunk

  • SMF Hero
  • ******
  • Posts: 3,491
    • ApplianceJunk.com
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #20 on: September 10, 2007, 09:02:44 PM »
Thank you for the info, it was very helpful. I still have a couple questions on backing up.

Number one and two work fine for me.
Is there any difference between doing one or the other?

1.Through ''Forum Maintenance'' in the Admin Panel
2.Through phpmyadmin at the Control Panel of your host

I don't really understand what is getting backed up here.

It is backing up everything, including photos, attachements, text in the post, etc.. Everything I would need to restore my forums just like they were?

Along with doing the Forum Maintenance backup in the Admin Panel I use my ftp program to copie all my forum files back to my hard drive.

When I copie my forum files back to my hard drive using my ftp program does that save the text and post that were created in my forums too?

Do I need both my ftp files and the two file I create using "Forum Maintenace" backup or just one or the other?

Thanks,

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #21 on: September 10, 2007, 09:32:42 PM »
Probably not, but I have seen cases where users were having issues restoring the ones made from the forum....maybe forgot to backup the table structure? I usually recommend backing up using phpMyAdmin instead as it haven't failed me yet :)

The database is getting backed up. The database includes all your posts, members, etc. Attachments and images might have to be backed up separately...they should be in the Attachments and Avatars folders in cPanel/FTP.

No. Your database will have all the posts and members.

The PHP files you are FTPing are less important. You only need to worry about those if you have a lot of mods and themes installed. The more important part is the database. This includes ALL your posts information and memberlist which is the bulk of your forum.

Offline ApplianceJunk

  • SMF Hero
  • ******
  • Posts: 3,491
    • ApplianceJunk.com
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #22 on: September 10, 2007, 10:38:46 PM »
Quote
The PHP files you are FTPing are less important.

If I want to restore all photos from my image gallery I will need the /forums/gallery file/folder, right?

If I copy all files back to hard drive via ftp, export MySql database using Control Panel and Admin Panel "Forum Maintenance" I should be safe and have everything I would ever need to build my forums from scratch?


Offline searchgr

  • Sophist Member
  • *****
  • Posts: 1,247
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #23 on: September 11, 2007, 01:30:43 AM »
Yes.

Offline Fiery

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,221
  • Gender: Male
  • Community Builder
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #24 on: October 10, 2007, 01:27:25 AM »
Hello,

I am following up on old support topics.  Was everything resolved to your liking?

Thanks

Offline triple

  • Semi-Newbie
  • *
  • Posts: 66
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #25 on: October 25, 2007, 07:57:58 AM »
using phpmyadmin my admin i followed your instructions, saved ME_smf1 to my desktop.

now i try to upload the file to the import tab.

everything hangs, i try several times.

HELP?
« Last Edit: October 25, 2007, 08:01:35 AM by triple »

babjusi

  • Guest
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #26 on: October 25, 2007, 11:05:11 AM »
using phpmyadmin my admin i followed your instructions, saved ME_smf1 to my desktop.

now i try to upload the file to the import tab.

everything hangs, i try several times.

HELP?

How mb is your backup copy, because phpmyadmin has file size limits.

Offline SleePy

  • Let there be light!
  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,498
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #27 on: November 02, 2007, 01:24:10 PM »
Lets move this to Tips and Tricks.. :)
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline Ol' Wombat

  • Full Member
  • ***
  • Posts: 472
  • Gender: Male
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #28 on: November 22, 2007, 11:05:12 PM »
Concerning phpMyAdmin there seems no brief information about the ton of export options you can/have to check when exporting a database.

Same is valid for importing a database.

the DB tutorial (http://docs.simplemachines.org/index.php?topic=490.0) here on SMF is way too basic and of no help at all for noobs.

Now, where is a phpMyAdmin tutorial that actually *details* the steps needed, including all checkboxes on the way,  to successfully export/import a full database?

Anyone?  8)

 



Offline trekkie2444

  • Full Member
  • ***
  • Posts: 602
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #29 on: February 02, 2008, 12:57:47 AM »
I just ran the restore.php script by [Unknown] and it screwed up and told me that the files weren't readable when I uploaded my backup .sql for the thing on there to my forum directory.

Offline Kat9119

  • Full Member
  • ***
  • Posts: 482
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #30 on: February 13, 2008, 02:33:33 PM »
Quote
3. Select"SQL"-> for output format, Check "Structure" and "Add AUTO_INCREMENT" value. Check "Enclose table and field name with backquotes". Check "DATA", check use "hexadecimal for binary field". Export type set to "INSERT".

I don't have that option the only option I have is "Use hexadecimal for BLOB" I'm going to assume its the same thing.

Also, when I go to submit, there is a little exclimation point image next to it, that states the following:

The SQL compatibility mode functionality is affected by a known bug, see http://bugs.mysql.com/14515

is that normal?

Offline Ashu

  • Semi-Newbie
  • *
  • Posts: 28
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #31 on: February 14, 2008, 11:44:23 PM »
wow thanx guys....i was really fighting with the backup n restore problem.....i love this tutorial.....but i have a another problem....when i restored ma backup to another site its not working i mean after restoration when i click on any board it redirect me to ma hosting server....can anyone help me in this....pls

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #32 on: February 19, 2008, 05:24:30 PM »
Did you use repair_settings.php? Looks like you might have skipped that part...Use repair_settings.php and make sure that the database information is correct. Then click on the Recommended values. Save the changes. That should restore your forum back to working order. Delete the repair_settings.php file once you are done.

@Kat9119: You can usually leave it as the default setting and export/backup the database that way. I suggest restoring on a test forum to verify that it works first.

Offline ckkapoor

  • Semi-Newbie
  • *
  • Posts: 28

If i want to change my hosting place, so I want to re install my SMF Forums..?

:- I have many members so plzz suggest me how i change my host place without loss my all members..plzz help me as sson as possible

I didn't understant d 1st method sorry can you plzz explain me

Thanx in advance

babjusi

  • Guest

If i want to change my hosting place, so I want to re install my SMF Forums..?

:- I have many members so plzz suggest me how i change my host place without loss my all members..plzz help me as sson as possible

I didn't understant d 1st method sorry can you plzz explain me

Thanx in advance

Make a thorough backup of your database. Create a mysql database and user to the new host, don''t forget to grant the user full access and permissions to the database. Then upload all the forum files from the old server space to your pc and re-upload them to the new server space of your new host. After you do this, you can import the database from the old host to the new host. Open the settings.php file with a good php editor program and enter the new db info in there. As last but not least, run the repair_settings.php file and click on all the blue recommended values to update all the paths, urls and the other settings and when you are done, delete it. Like this, all mods and custom themes that you have will be preserved intact

Or, you can simply install a new smf at the new host and then import the database and do the thing with the repair_settings.php. Only thing, you will loose all mods and custom themes that you had.

Hope it helps :)

Should you run into more problems post them here or start a new topic

Offline L.G.S

  • SMF Hero
  • ******
  • Posts: 2,658
  • Gender: Male
  • RuthlessIntent.com !
    • GamesandGoals.com
I don't know if it's just my host (they use Cpanel if it matters) but won't my database hit around 15mb in size it stopped working from the backup feature in the SMF admin panel. I've had to use the Cpanel backup ever since.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Offline thestir

  • Newbie
  • *
  • Posts: 3
I want to thank you for this tutorial.  I built a site for a friend and it grew to a point that I wanted to move it his own hosting account.  Using this tutorial and the "How do I move my SMF board to a different host?" tutorial it went very well.

I used phpmyadmin to backup my database to a folder on my site, then downloaded both the database backup and the public html files.

I then pushed the public html files and the database backup to the new host, restored the database through phpmyadmin, and ran repair_settings.php.

The site came right up and seems to be working perfectly,
Thank you very much,
Scot

Offline jepot5

  • Jr. Member
  • **
  • Posts: 268
just a note
if you are moving to a different server, i recommend number 2
number 1 will cause too many 1067 errors on every table that has settings for each members

Offline jvbucks

  • Semi-Newbie
  • *
  • Posts: 12
Is there a way to just restore a certain forum?
Vanessa
Newbie to SMF

Offline dpiffy

  • Semi-Newbie
  • *
  • Posts: 51
  • Gender: Male
I made a backup using "unknowns" php file, and saved it successfully. I then used Bigdump importer to put the file back on. THat didn't seem to work right. SO i ended up just going into my database on which my new server and database is for my new smf is at, dumped all the stuff in it, then used the import feature from the MySQL for that database, and it said it sucessfully imported all tables, etc. I tried going to my boards now.. and i get this error message:

: Unknown column 'a.attachmentType' in 'field list'
/home/content/d/p/f/dpfiffner/html/boards/Sources/Load.php
390


what is it actually saying is wrong? I've looked through the load.php file and looked for attachmenttype, i even went back into the sql database and found the field attachmenttype. but i dont know what the error means and what i have to do to correct this? any ideas?

Offline angrybanana5000

  • Semi-Newbie
  • *
  • Posts: 29
    • Gamers Crib
I have done this as I am switching hosts but when I imort it to my new host it says access denied.

babjusi

  • Guest
I have done this as I am switching hosts but when I imort it to my new host it says access denied.

Access denied to what? Is the access denied to the db user for the db that you have created? If so, make sure to give the user full permission and access to the database. If that is not the case, can you please post here the full ''access denied'' message that you are getting?

Offline Gà Mái

  • Jr. Member
  • **
  • Posts: 258
  • Gender: Female
Re: A a tutorial of ''How to backup your forum&restore it in different ways''
« Reply #42 on: September 10, 2008, 02:59:42 PM »
Many thanks. Marked to find later!
-- I love SMF --

Offline tittiger

  • Semi-Newbie
  • *
  • Posts: 53
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #43 on: September 13, 2008, 07:36:08 PM »
Does the built in SMF tool also restore the database?

And what of the SMF directory files themselves? How to back them up and restore
and are there any caveats?

From experience I know that backups and restores have a lot of pitfalls.

Personally  may try installing SMF into a Joomla database, whether or not I am using
the Joomla installation because then I can use Joomla Cloner http://www.joomlaplug.com/
to do both the backup and restore.

It seems sort of round about but like I said, too many pit falls
with most methods.


« Last Edit: September 20, 2008, 12:27:49 PM by tittiger »

Offline dwd2000

  • Jr. Member
  • **
  • Posts: 193
  • Gender: Male
  • Is it Friday yet?
    • Dave's Games
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #44 on: September 20, 2008, 12:22:29 PM »
Thanks for the "Restore" tutorial.
I have 3 sites and accidentally overwrote an index.template on one site with another. (all using "default")
Lucky I backed up a few days before with tables included.


30 years ago I was young and foolish.
Now I'm just young.

DAMMIT JIM...I'M A TWEAKER...NOT A CODER!!!

Dave's Games

Offline vaarplezier

  • Semi-Newbie
  • *
  • Posts: 19
  • Gender: Male
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #45 on: November 19, 2008, 05:57:56 PM »
When i try to restore with phpADMIN:
 vaarplezier-complete_2008-11-04.sql

i do get the next message :


------------------------------------------------------------------------------
SQL-query:

CREATE TABLE `smf_vaarpleziersessions` (

session_id char( 32 ) NOT NULL default '',
(X) last_update int( 10 ) unsigned NOT NULL default '',
DATA text NOT NULL default '',
PRIMARY KEY ( session_id )
) TYPE = MYISAM ;



MySQL retourneerde: 

#1067 - Invalid default value for 'last_update'
------------------------------------------------------------------------
i also tried with my other backup files and i get the same message ... :(
« Last Edit: November 19, 2008, 06:01:21 PM by vaarplezier »
Tot later,Georges

babjusi

  • Guest
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #46 on: November 20, 2008, 07:34:07 AM »
@vaarplezier, try to search the forums as this kind of error has been asked/answered plenty of times before :)

Offline Swayforth

  • Semi-Newbie
  • *
  • Posts: 62
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #47 on: November 20, 2008, 02:55:48 PM »
I am not sure if this has been asked yet or not but how would i restore to a fresh install of SMF into a new folder on the same site/host and restore the forum like it was in the original site.

Original site running version1.1.7 upgraded from 1.1.3 install so im not sure if the databases would match when i restore to a clean install of 1.1.7.

I found this infor very helpful cuz my database is 15mb and have learned of new ways to restore which i will try when i get off of work.

thanks for any help you could provide.


babjusi

  • Guest
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #48 on: November 20, 2008, 02:59:18 PM »
I am not sure if this has been asked yet or not but how would i restore to a fresh install of SMF into a new folder on the same site/host and restore the forum like it was in the original site.

Original site running version1.1.7 upgraded from 1.1.3 install so im not sure if the databases would match when i restore to a clean install of 1.1.7.

I found this infor very helpful cuz my database is 15mb and have learned of new ways to restore which i will try when i get off of work.

thanks for any help you could provide.



There are no db changes among the versions of the same series, so a 1.1.3. db will be restored fine in a 1.1.7 forum :)

Now, for the other part, you want to move your forum from a folder to another one? Cos if that is the case, no restore is needed. Can you tell me exactly in which folder your forum is and in which folder you want to move it?

Offline Swayforth

  • Semi-Newbie
  • *
  • Posts: 62
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #49 on: November 20, 2008, 04:12:20 PM »
thanks for your quick reply. Reason why i want to change directory is to do a fresh install of SMF then restore back to it. /forums to /forum.

When i first started using SMF i installed it from the control panel on godaddy ... well i have different issue with this and would like to install it fresh and not use the control panel.

Plus i am using this as a learning experience for a backup/restore, better to know before you need to do it  :P 

babjusi

  • Guest
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #50 on: November 20, 2008, 04:39:33 PM »
thanks for your quick reply. Reason why i want to change directory is to do a fresh install of SMF then restore back to it. /forums to /forum.

When i first started using SMF i installed it from the control panel on godaddy ... well i have different issue with this and would like to install it fresh and not use the control panel.

Plus i am using this as a learning experience for a backup/restore, better to know before you need to do it  :P 

As I said, if you want to change folders then no restore is needed. All you have to do is rename your forum folder from forums to forum via the ftp client or the file manager in the cp of your host and run the repair_settings.php file to straighten out all the urls, paths and the other settings :)

If you want to exercise yourself with the backup/restore process, then you can install a test forum, export the db from your live forum and import it at the test''s forum''s db.

Offline Swayforth

  • Semi-Newbie
  • *
  • Posts: 62
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #51 on: November 20, 2008, 05:21:29 PM »
I'm not changing folders just to change folders ... i want a fresh (manual - not installed by godaddy software options) install of SMF with all my data in it.

Reason i want to do this is because i tried to update SMF using godaddy and it killed the forum had to roll back to get it up and running again. Well i would much rather install it myself and not have godaddy install it. (i think i was trying to get the core files to match)

File Maintence - Check all files against current versions.

i know im just being picky but i have always learned that if you want it done right you need to do it yourself :)

thank you for your help though

Offline JeffGoudreau

  • Semi-Newbie
  • *
  • Posts: 32
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #52 on: September 27, 2010, 03:26:10 PM »
Ok. So my friend with his server is getting attacked by viruses and he says I have to find new hosting for my site. It is version 1.1.11 www.canadiankayakanglers.com and here is the problem Im running into. I dont know what I am doing :( haha. I was told that the option 1. SMF forum maintanance option you are suggesting isnt going to backup the gallery and the avatars and possible other things. I need to backup the entire site. Which option would you suggest someone that has no experience at this. I am willing to learn. I just dont want to disappoint my members and have us lose everything when we do a server change. Also do you guys know what server host is best for SMF? I was told that Godaddy isnt the greatest and Im not sure which to go with. Suggestions would be appreciated :)
Thanks
 

Offline Lucky Chance

  • Newbie
  • *
  • Posts: 1
Re: [Tutorial] ''How to backup&restore your forum in several different ways''
« Reply #53 on: October 04, 2010, 02:47:29 PM »
Hi everyone!

I have a SMF Community which I also just aquired a WHM account with a new host.  I have been trying to get This Site which is a addon, into it's own Cpanel.  I have tried the steps above each time I do however I am getting a error.  I don't know what I am doing with this part of websites, never have done it, have attempted is all.  I asked host if they would do it I can copy all files etc, just don't have enough knowledge on doing the database and would assume not lose 6 months of postings. 

Does anyone know how to move a Addon from a WHM into it's own cpanel?  Can you describe step by step on how to do for SMF?  I would appreciate it a lot.

Thanks