{"id":421,"date":"2010-09-15T10:50:13","date_gmt":"2010-09-15T05:50:13","guid":{"rendered":"http:\/\/linuxndme.com\/?p=51"},"modified":"2011-06-18T03:25:24","modified_gmt":"2011-06-18T03:25:24","slug":"directadmin-migration","status":"publish","type":"post","link":"https:\/\/blog.nixwind.com\/?p=421","title":{"rendered":"DirectAdmin migration"},"content":{"rendered":"<p><strong>Overview<\/strong><\/p>\n<p>A how to for doing DirectAdmin to DirectAdmin server migration. This can assist you on\u00a0 complete account migration from Oldserver to Newserver , with rsync, sysbackup and manual restoration.<\/p>\n<p><strong>Requirements<\/strong><\/p>\n<ul>\n<li>Basic idea of DireactAdmin files and directories<\/li>\n<li> You must have a new server with DirectAdmin Licensed and installed<\/li>\n<li>You must make sure that the version of Apache, php and mysql installed on both servers matches<\/li>\n<\/ul>\n<p><strong>Migration<\/strong><\/p>\n<p>DirectAdmin does have a utility called <strong>System Backup<\/strong> to backup all the needed configuration files and directories in the\u00a0 server, but unfortunately it doesn&#8217;t come with a restoration tool. So we will have to do it in the manual way. Home directories will be synced and mysql databases will be backedup and restored\u00a0 separately.<\/p>\n<p><strong>Step 1<\/strong><\/p>\n<p>Run System Backup on the old server.<\/p>\n<p><a title=\"System Backup\" href=\"http:\/\/blog.nixwind.com\/wp-content\/uploads\/2010\/09\/SystemBackup.png\" target=\"_blank\"><img decoding=\"async\" loading=\"lazy\" class=\"size-thumbnail wp-image-57\" title=\"System Backup\" src=\"http:\/\/blog.nixwind.com\/wp-content\/uploads\/2010\/09\/SystemBackup-300x160.png\" alt=\"System Backup\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p><strong>Admin Tools &gt;&gt; System Backup<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>We will be backuping home directories and mysql db&#8217;s manually so <strong>Uncheck<\/strong> <strong>and unselect<\/strong> the following options on System Backup<\/p>\n<p><em>Add user home directories to directory list below<\/em><\/p>\n<p><em>Backup httpd data<\/em><\/p>\n<p><em>Backup MySQL Databases<\/em><\/p>\n<p><strong>Check and Select<\/strong><\/p>\n<p><em>Backup DNS data<\/em><\/p>\n<p><em>Backup Directories and Files listed below<\/em><\/p>\n<p><em>All directories\/files listed in bottom section of the System Backup<\/em><\/p>\n<p>now click on the <strong>Run System Backup Now<\/strong> icon . The backup will be stored mostly in \/home\/backup ( it will depend upon how you have set it in DA )<\/p>\n<p><strong>Step 2<\/strong><\/p>\n<p>rsync the system backup to the Newserver.<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@old:~#<\/span><\/strong><strong> rsync -avurz -e ssh &#8211;delete \/home\/backup root@Newserver_IP:\/home\/backup<\/strong><\/p>\n<p><strong>Step 3<\/strong><\/p>\n<p>On the Newserver restore the system backups one by one manually.<\/p>\n<p>For example, for restoring your \/etc\/virtual directory,<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@new:~#<\/span><\/strong><strong> cd \/etc<br \/>\n<\/strong><strong><span style=\"color: #3ea99f;\">root@new:~#<\/span><\/strong><strong> tar xvzfp \/home\/backup\/&lt;backup_date&gt;\/custom\/etc\/virtual.tar.gz<\/strong><\/p>\n<p>Please check <a title=\"DirectAdmin Paths\" href=\"http:\/\/www.directadmin.com\/paths.html\" target=\"_blank\">here<\/a> for the complete paths and files used on a DirectAdmin system.<\/p>\n<p>( Do take extra care while restoring \/etc\/passwd \/etc\/shadow \/etc\/group etc.. )<\/p>\n<p><strong>Step 4<\/strong><\/p>\n<p>Synchronise the home directory<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@old:~#<\/span><\/strong><strong> <\/strong><strong>rsync -avurz -e ssh &#8211;delete \/home root@Newserver_IP:\/home<\/strong><\/p>\n<p><strong>Step 5<\/strong><\/p>\n<p>Backup and restore the mysql DB&#8217;s<\/p>\n<p>On Oldserver<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@old:~#<\/span><\/strong><strong> <\/strong><strong>cat \/usr\/local\/directadmin\/conf\/mysql.conf<\/strong><\/p>\n<p>Get the da_admin password from the above file<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@old:~#<\/span><\/strong><strong> <\/strong><strong>mysqldump -u da_admin -p\u00a0 &#8211;all-databases &gt; \/root\/all_databases.sql<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@old:~#<\/span><\/strong><strong><strong> <\/strong>scp \/root\/all_databases.sql root@Newserver_IP:\/root<\/strong><\/p>\n<p>On Newserver<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@new:~#<\/span><\/strong><strong> <\/strong><strong>cat \/usr\/local\/directadmin\/conf\/mysql.conf <\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@new:~#<\/span><\/strong><strong> <\/strong><strong>mysql -u da_admin -p &lt; \/root\/all_databases.sql<\/strong><\/p>\n<p><strong>Step 6<\/strong><\/p>\n<p>Use the ipswap script to change the Oldserver IP&#8217;s<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@new:~#<\/span><\/strong><strong> <\/strong><strong>cd \/usr\/local\/direactadmin\/scripts\/<\/strong><\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@new:~#<\/span><\/strong><strong> <\/strong><strong>.\/ipswap.sh Oldserver_IP\u00a0 Newserver_IP<\/strong><\/p>\n<p><strong>Step 7<\/strong><\/p>\n<p>Update the nameservers to the Newserver IP&#8217;s.<\/p>\n<p><strong>Step 8<\/strong><\/p>\n<p>To resolve all the queries correctly to the new server . You will have to setup the multi server dns clustering on the new server<\/p>\n<p><strong>Multi Server Setup<\/strong><\/p>\n<p>on, <strong>Add Remote Server<\/strong><\/p>\n<p>Input the Oldserver IP , login :\u00a0 admin and password<\/p>\n<p>IP:<\/p>\n<p><input name=\"ip\" size=\"15\" type=\"text\" \/>Port:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><input name=\"port\" size=\"4\" type=\"text\" value=\"2222\" \/>SSL:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><input name=\"ssl\" size=\"4\" type=\"checkbox\" value=\"yes\" \/><\/p>\n<p>Username:<\/p>\n<p><input name=\"user\" size=\"8\" type=\"text\" \/> Password:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><input name=\"user\" size=\"8\" type=\"text\" \/><\/p>\n<p>Click <strong>Add<\/strong><\/p>\n<p>next on, <strong>List of External Servers<\/strong><\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>Zone Transfer:<\/td>\n<td><input checked=\"checked\" type=\"checkbox\" value=\"yes\" \/><\/td>\n<\/tr>\n<tr>\n<td>Domain Check:<\/td>\n<td><input checked=\"checked\" type=\"checkbox\" value=\"yes\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>select the server<\/strong><\/p>\n<p>Click connections &#8220;<strong>Test Connection(s)<\/strong>&#8221;\u00a0 to check the connection.<\/p>\n<p>If the test runs OK, <strong>Turn Multi Server On<\/strong> on the top<\/p>\n<p>and run the below to sync the zone files<\/p>\n<p><strong><span style=\"color: #3ea99f;\">root@new:~# <\/span><\/strong><strong>echo \u201caction=rewrite&amp;value=named\u201d &gt;&gt; \/usr\/local\/directadmin\/data\/task.queue<\/strong><\/p>\n<p>Now you&#8217;ll be able to access the domains from the new server , do tail the logs to see if everything is fine \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview A how to for doing DirectAdmin to DirectAdmin server migration. This can assist you on\u00a0 complete account migration from Oldserver to Newserver , with rsync, sysbackup and manual restoration. Requirements Basic idea of DireactAdmin files and directories You must have a new server with DirectAdmin Licensed and installed You must make sure that the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[49],"tags":[50,51],"_links":{"self":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/421"}],"collection":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=421"}],"version-history":[{"count":4,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/421\/revisions"}],"predecessor-version":[{"id":434,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=\/wp\/v2\/posts\/421\/revisions\/434"}],"wp:attachment":[{"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nixwind.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}