Migrate Webserver

Freshly setup a new VE and copy over config/data files from older one. A field tested example:

1. Setup new VE (1100)

2. On new VE: apt-get install php5-mysql php5-gd php5-imagick

optional: cronolog imagemagick locate less

3. check for conflicting GID/UIDs:
diff /mnt/vz1/private/1100/etc/group /mnt/vz3/private/1003/etc/group

diff /mnt/vz1/private/1100/etc/passwd /mnt/vz3/private/1003/etc/passwd

4. If no conflicts:

root@vz2011:/mnt# cp /mnt/vz3/private/1003/etc/group /mnt/vz1/private/1100/etc/
root@vz2011:/mnt# cp /mnt/vz3/private/1003/etc/passwd /mnt/vz1/private/1100/etc/
root@vz2011:/mnt# cp /mnt/vz3/private/1003/etc/shadow /mnt/vz1/private/1100/etc/
root@vz2011:/mnt# cp -Rp /mnt/vz3/private/1003/etc/apache2/* /mnt/vz1/private/1100/etc/apache2
root@vz2011:/mnt# cp -Rp /mnt/vz3/private/1003/home/* /mnt/vz1/private/1100/home

envvars has to be taken from a fresh install:

root@vz2011:/etc/vz/conf# cp /etc/apache2/envvars /mnt/vz1/private/1100/etc/apache2

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.