Moving sites from A to B server.

Discussion in 'General' started by sv102, Feb 17, 2016.

  1. sv102

    sv102 New Member

    Hello! how can I migrate my sites from one server to another? Is there any manual? (Debian 8, Ispconfig3)
     
  2. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    https://www.howtoforge.com/community/threads/postfix-migration-from-old-box-to-new-box.44857/

    With special attention to copy /etc/passwd and groups before extracting data on target system.
    In theory copying apache vhost files isn't needed since you can let ISPConfig recreate them by using rsync option at the tools page.

    But yeah, setting up just like you did before, move files and database ( including mysql database ) do rsync let the cronjob do it's thing and you should be ready to go again.
     
  3. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    DDArt likes this.
  4. sv102

    sv102 New Member

    I want to move only 1-2 websites.

    I'm on the new server created new webdomain (name site.ru) in isponfig panel. Use ssh on new server:
    Code:
    cd /var/www/site.ru
    ls -l
    I see:
    Code:
    drwxr-xr-x  2 web2 client1 cgi-bin
    drwxr-xr-x 16 web2 client1 log
    drwx--x---  2 web2 client1 private
    drwxr-xr-x  2 web2 client1 ssl
    drwxrwx---  2 web2 client1 tmp
    drwx--x--x 21 web2 client1 web
    drwx--x---  3 web2 client1 4096 май  2  2015 webdav
    
    And use rsync (192.168.10.150 - old server) and mysqldump:
    Code:
    rsync -og --chown=web2:client1 -avz -e ssh [email protected]:/var/www/site.ru/ /var/www/site.ru/
    mysqldump -h 192.168.10.150 -u root -p site-bd > site-bd.sql
    scp site-bd.sql [email protected]:/var/www/site.ru
    mysql -h hostname -u username -p site-bd < site-bd.sql
    
    But i see on webpage error
    ERROR 500 - Internal Server Error!:(:(:(
    I'm doing this for the first time.
     
  5. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    Do tail -f log/error_log in /var/www/site.ru/ directory and request page, what's getting added to the logfile?
     
    sv102 likes this.
  6. sv102

    sv102 New Member

    Code:
    /var/www/site.ru# mkdir log/error_log.log
    /var/www/site.ru# nano log/error_log.log                    #save clean and exit
    /var/www/site.ru# tail -f log/error_log.log
    open site.ru on browser and see file error_log.log
    But error_log.log is clean:(
     
  7. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    oh well, I'm sorry - I made a typo.
    I meant error.log - it should be in place within log folder with no need to create it.
     
    sv102 likes this.
  8. sv102

    sv102 New Member

    Code:
    root@webhost:/var/www/site.ru/log# nano error.log
    [Mon Feb 22 10:35:03.478050 2016] [:error] [pid 2064] [client 192.168.10.1:60121] terminate called after throwing an instance of '
    [Mon Feb 22 10:35:03.478134 2016] [:error] [pid 2064] [client 192.168.10.1:60121] suPHP::LookupException
    [Mon Feb 22 10:35:03.478147 2016] [:error] [pid 2064] [client 192.168.10.1:60121] '
    [Mon Feb 22 10:35:03.478278 2016] [core:error] [pid 2064] [client 192.168.10.1:60121] End of script output before headers: index.php
    o_O
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you chown the files to the right user and group on the new server? And you should not use the deprecated suphp, better use php-fpm or fastcgi + suexec.
     
    sv102 likes this.
  10. sv102

    sv102 New Member

    You helped!:)
    1. Created domain in ispconfig on new server (use php-fpm or fastcgi)
    2. Copy web and database
      Code:
      rsync -og --chown=web2:client1 -avz -e ssh [email protected]:/var/www/site.ru/ /var/www/site.ru/
      mysqldump -h 192.168.10.150 -u root -p site-bd > site-bd.sql
      scp site-bd.sql [email protected]:/var/www/site.ru
      mysql -h hostname -u username -p site-bd < site-bd.sql
      check phpmyadmin
    3. Changed settings joomla configuration file
      Code:
      root@webhost:/var/www/site.ru/web# nano configuration.php
      $db, $user, $password and other
    Thank you all! :):):)
     

Share This Page