-1

I do not have access to the physical hard drive of the server, but I do have SSH and FTP access. How would I go about moving all of the data from one CentOS server to another server box? It is a dedicated server and I am trying to upgrade to a better server box, but I have absolutely no clue where I would start to migrate it. My hosting company does not manage the servers and I have been told I will need to do it manually. A backup seems like the logical option but I have no idea how I would create the backup. Last time I tried to backup (into a tar file) lots of files corrupt as they were constantly changing. Would I need to stop ALL of the services running on the box, or is there some way I could go about this without "breaking" everything?

daviga404
  • 101
  • 1
  • 1
  • 1
    This is far too complex a question for a simple Q&A forum. The best advice we can give you is "Make a backup, restore it to the new box, and test to make sure you didn't break anything." -- Making the backup is left as an exercise for the reader (what you grab and how you grab it depends on your environment), as is the restore/test process (which depends on what your server does). – voretaq7 Apr 29 '13 at 15:09
  • possible duplicate of [Need to replicate server environment - Where to start?](http://serverfault.com/questions/501090/need-to-replicate-server-environment-where-to-start) – Jenny D Apr 29 '13 at 15:13

2 Answers2

3

You don't tell us what is running on the server, so my advice is generic.

If you don't know how to backup and migrate your server it sounds like you wouldn't know what to do in the event of a disaster or hardware failure. Start by figuring out what data is not replaceable by a rebuild. This all depends on what your server does and is running. For example, a web server. Backup your Apache configs (/etc/httpd/conf*) and DocumentRoot (/var/www/html/*.) Test your restore to the new host before shutting down the old one.

If files are constantly changing, yes, you should stop the services to make a "stateful" backup. Certain services have a provision though for making a 'hot copy.' If the service has no provision for a hot copy, you can use LVM snapshots. (Assuming your filesystem lives on LVM.)

Aaron Copley
  • 12,525
  • 5
  • 47
  • 68
  • Sorry, I probably should have mentioned the software. We have a few Bukkit servers running for Minecraft, a ZPanel daemon and the required software for it (e.g. Apache w/ PHP, MySQL, BIND). Other than those, I don't believe we have much else. Obviously we will stop the Minecraft servers gracefully before even attempting to transfer the server. – daviga404 Apr 26 '13 at 20:51
0

As a general recommendation: You should always install Linux twice on such systems. A small service Linux makes many serious tasks easier (and a lot faster). That way you could easily backup your main installation because it would be inactive during this.

  1. You should start with partitioning the new server (including mkfs on the volumes for the main system) and installing a service Linux.
  2. Then you should boot the old system from CD/DVD and mount the partitions you want to copy.
  3. You need a working SSH connection from the CD boot on the old system to the new one.
  4. On the new system you have to mount the target volumes.
  5. Then you can copy the data, e.g. using tar:

    cd /path/to/source_volume_1 tar -czf - --one-file-system . | ssh -e none root@newserver 'tar -xf - -C /path/to/target_volume_1'

Hauke Laging
  • 5,285
  • 2
  • 24
  • 40