I have setup a new Ubuntu server. I have re-installed EHCP, how do i migrate all my sites to the knew server. I have made a backup and transfered the file to the new server. The restore doesn't work.


check size of backup file.
put backup file in /var/backup
(before starting restore, you may tail -f /var/log/ehcp.log , so that you will see whats going on.)

click on ehcp->backup->restore
write backup file with .tgz extension
issue backup command.
check ehcp.log output in your console, tail -f

one of the results show unable to find /var/www but this exists and the permissions are correct. It does so restore was successful and I need to restart ehcp, but there is nothing. Does it matter that the ubuntu versions are not the same as the ubuntu on the new server is Lucid and the old server was Jaunty.

no, ubuntu versions are not important. because /var/www remains same.
make sure your ehcp daemon is running;
as root: /etc/init.d/ehcp restart

watch your /var/log/ehcp.log and note any error that may affect restoring.
if you wish send email to info@ehcp.net

I have an old ubuntu 9 server with some 2009 version of EHCP and i made a new server with latest ubuntu and latest EHCP becouse the old server was hacked, I dont know how. So, I have backup all files and databases.
The restore apears to be complete after only a few minutes (ehcp said so) but all that is done is to unzip the archive in a folder with two new files, a database file (200mb) and a file archive (5 GB). At this point it stops. I have no sites, no users, nothing.
So, I have manualy copied site files in var/www/vhosts.
The big problem is with that big database file becouse if I use 'mysql -u... -p... < file.sql' command, an error tells me that I have selected no database.
So, i tryed to mysqldump --all-databases from the old server and to install this file on the new server. After 10 minutes of running text on the screen, i see no database :( No users, no domains in ehcp.
Please help, I have tried everything for 30 hours :(

As I understand, your old ehcp has finished the backup a little bad, like: no "use dbname;" statements. that is behaviour of old ehcp (now fixed).

to load your old db file:
open that db file, in appropriate positions, append commands like:

create database ehcp;
use ehcp;


create database yourdb1;
use yourdb1;

like this.. you need to find out/guess the positions these instructions.
in fact, create db instructions can be given at any time, maybe by hand, or at start of that file, however, "use db" statements must be at proper location.

hope this will help.

Ok, now all the databases and files are in right place, but i had a problem with the ehcp DB. Actual ehcp version is different than the old server, so, if i delete the new ehcp db and put instead the old one, some ehcp features are broken. (I have allready tried this)
So, my only option was to extact the domains, users, ftp and email tables and insert them in the new ehcp DB.
This works almost fine. All users, domains, etc.. are in their place in EHCP.
But I think something is still wrong becouse if i want to copy a file with an ftp user to his site, i get an error. The ftp is working, i see files, i can get them, but i cannot copy any new files.
What steps i forgot?
This is only one problem that i saw this far. I hope is the only one but i dont know to resolve it...

* you can put old ehcp db to a new ehcp, then, logout, login. ehcp will try to fix your ehcp db automatically while logging ing.

* if you cannot put your files to ehcp, do this in console:
cd /var/www/vhosts
chown vsftpd:www-data * -Rvf

this will fix file ownership, and you will be able to upload files.

The new install created /var/backups and not /var/backup

Transfered my sites to a new server with different IP using this guide http://colekcolek.com/2012/01/26/migrate-ehcp-server/.

Is it possible to test the sites before switching DNS to the new address?

I have tried http://internal_ip/vhosts/user/website.com but this doesn't work.