View Full Version : Backing up and restoring
mphayesuk
19th October 2005, 12:30
Ok is there a way to make a backup of customer account data, ie all of them from one server. Install and configure a new server and then import the customer account details into the new one. This way I dont lose any passwords ect.. that the customer creates if I decide to get a new and faster server to use as my hosting server.
Am I making sense.....
Thanks
falko
19th October 2005, 14:27
This might give you an idea how to start:
What is the best way to install an ISPConfig-Update?
Normally an ISPConfig-Update does not cause any problems. Since ISPConfig is installed on a multitude of different systems and because we have heard of sporadic problems with updates which we could not reproduce in spite of testing intensively, we publish some tips/hints here that should prevent a failed update to paralyse your system.
Please note: Placeholders are indicated by square brackets [ ].
1) First make a backup of your existing (working) ISPConfig installation:
Open a root shell (under Windows you can use PuTTY ( http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html ) for this task).
cd /root/
tar -pczf root_ispconfig_old.tar.gz ispconfig/
cd /home/
tar -pczf home_admispconfig_old.tar.gz admispconfig/
If your MySQL database is protected by a password:
mysqldump -h [name of your server, e.g. localhost] -u [database user, e.g. root] -p[database password] -c --add-drop-table --add-locks --all --quick --lock-tables [name of the ISPConfig database] > existing_db.sql (no space character between -p and password!)
Otherwise:
mysqldump -h [name of your server, e.g. localhost] -u [database user, e.g. root] -c --add-drop-table --add-locks --all --quick --lock-tables [name of the ISPConfig database] > existing_db.sql
Save /etc/passwd, /etc/shadow and /etc/group.
Save /etc/init.d/ispconfig_server and (if existing) /etc/init.d/ispconfig_tcpserver.
You should transfer the files named above(existing_db.sql, /etc/passwd, /etc/shadow, /etc/group, /etc/init.d/ispconfig_server, /etc/init.d/ispconfig_tcpserver) to your workstation (e.g. with WinSCP: http://winscp.sourceforge.net/eng/ ).
2) Install the ISPConfig-Update (see here). Do not close your root shell immediately after the update (also do not close your WinSCP window)!
Open a second root shell and check if the root login still works! If it does not you can restore the root user in the root shell you have left open (e.g. by editing /etc/passwd and /etc/shadow or by playing back your backups of these two files via the open WinSCP window). Please take care that these files keep the same privileges as before!
3) Open the ISPConfig system in a browser and make a change (e.g. change a user's settings). After approx. 30 sec. you can check if the root login still works on the shell. If it does, you can undo the user settings change in the ISPConfig system and close all shells/WinSCP windows. Your ISPConfig update has been installed successfully!
4) If you realise with hindsight that the root login does not work on the shell you have the following possibilities to rescue your system (it is in no way necessary to format the system's hard disk and install a new system!):
4.1) If webmin ( http://www.webmin.com/ ) is installed as tar.gz (not rpm!), you can still login to webmin and fix the root user.
4.2) Boot your system from a Rescue-CD (e.g. http://sourceforge.net/projects/rescuecd/ ).
Login: root Password: rescue
Adjust your keyboard:
kbdmap
Mount the /-partition of your hard disk (mostly /dev/hda1):
mount -t [your filesystem, e.g. ext2|ext3|reiserfs|etc.] /dev/hda1 /mnt
chroot /mnt
Now you can find the passwd and shadow file under /etc and edit them in an editor (e.g. vi) or with programs like usermod. Repair your root user and reboot the system (do not forget ot remove the Rescue-CD from your CD-ROM):
shutdown -r now
4.3) If your server has a rescue mode (like the 1&1-Root-Server):
Boot your server into the rescue mode.
Mount the /-partition of your hard disk (mostly /dev/hda1):
mount -t [your filesystem, e.g. ext2|ext3|reiserfs|etc.] /dev/hda1 /mnt
chroot /mnt
Now you can find the passwd and shadow file under /etc and edit them in an editor (e.g. vi) or with programs like usermod. Repair your root user and reboot the system.
shutdown -r now
5) If you want to restore your old ISPConfig system, please do the following steps:
/etc/init.d/ispconfig_server stop
cd /root/
mv ispconfig/ ispconfig_new/
tar xvfz root_ispconfig_old.tar.gz
cd /home/
mv admispconfig/ admispconfig_new/
tar xvfz home_admispconfig_old.tar.gz
If your MySQL database is protected by a password:
mysql -h [name of your server, e.g. localhost] -u [database user, e.g. root] -p[database password] [name of the ISPConfig database] < existing_db.sql (no space character between -p and password!)
Otherwise:
mysql -h [name of your server, e.g. localhost] -u [database user, e.g. root] [name of the ISPConfig database] < existing_db.sql
Restore /etc/init.d/ispconfig_server (and /etc/init.d/ispconfig_tcpserver, where applicable) (e.g. by using WinSCP).
chmod 744 /etc/init.d/ispconfig_server
chmod 744 /etc/init.d/ispconfig_tcpserver (if existing)
/etc/init.d/ispconfig_server start
BTW, I'd also backup the /etc folder, your Postfix configuration, your Apache configuration, the BIND configuration, ftp configuration and restore them on the new system.
mphayesuk
19th October 2005, 15:06
Well... its not easy but that looks as though it will work. Thanks for that, hopefully I will never need it.
Thanks again
nenad
21st March 2006, 04:34
What's the purpose of built-in backup in ISPConfig?
It creates zip files which can be downloaded, but how they can be restored?
Management --> ISPConfigDatabase --> Backup Data
and
Tools & Options --> Backup Manager --> Backup
But how to restore them through ISPConfig web interface?
till
21st March 2006, 11:16
What's the purpose of built-in backup in ISPConfig?
It creates zip files which can be downloaded, but how they can be restored?
Management --> ISPConfigDatabase --> Backup Data
Thats a database dump of the ISPConfig mySQL DB.
Tools & Options --> Backup Manager --> Backup
Backup of websites.
But how to restore them through ISPConfig web interface?
You can restore them only by FTP.
willcee
12th August 2006, 15:57
hi you all,
i need to replace my server by another, so i need to backup ispconfig system, user datas, databases, and the webfolders of the users.
but i think i also need to backup the system users created by ispconfig?
should they have the same UID as on the old system?
cheers willcee
falko
13th August 2006, 19:55
Have a look here: http://www.howtoforge.com/forums/showthread.php?t=2717&highlight=moving+ispconfig
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.