{"id":334,"date":"2014-06-27T01:54:38","date_gmt":"2014-06-27T01:54:38","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=334"},"modified":"2014-06-27T01:54:38","modified_gmt":"2014-06-27T01:54:38","slug":"move-data-from-slaved-drive-plesk","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/06\/27\/move-data-from-slaved-drive-plesk\/","title":{"rendered":"Move Data from Slaved Drive &#8211; Plesk"},"content":{"rendered":"<p>First you will want to set up subscriptions for the domains in the plesk panel. Once they are created you can run the commands below:<\/p>\n<p>Here are a few commands that should help.<\/p>\n<p>1.) rsync example. This will move the data from one drive to the other.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nrsync -avz \/mnt\/slave\/var\/www\/vhosts\/&quot;domain name&quot;\/httpdocs \/var\/www\/vhosts\/&quot;domain name&quot;\/httpdocs\n\n<\/pre>\n<p>You will want to change the &#8220;domain name&#8221; to the one you are working on at the time.<\/p>\n<p>2.) Changing ownership:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nchown -R &quot;ftpusername&quot;:psacln \/var\/www\/vhosts\/&quot;domain name&quot;\/httpdocs\/*\n\n<\/pre>\n<p>You will want to change the &#8220;ftpusername&#8221; to what you set up for each domain when creating the subscription.<\/p>\n<p>If the sites are simple, these are the only 3 steps you should need to take for each domain.<\/p>\n<p>Update:<\/p>\n<p>I would use the rsync command rather than cp. Rsync will keep permissions the same. The command would look something like:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nrsync -aPSv \/mnt\/olddrive\/var\/www\/vhosts\/domain.com\/httpdocs\/somedirectory\/ \/var\/www\/vhosts\/domain.com\/httpdocs\/restoredirectory\/\n\n<\/pre>\n<p>You can also preview what will be synced by adding &#8211;dry-run to the command. This doesn&#8217;t actually copy anything, just shows you what&#8217;s going to happen e.g.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nrsync -aPSv \/mnt\/olddrive\/var\/www\/vhosts\/domain.com\/httpdocs\/somedirectory\/ \/var\/www\/vhosts\/domain.com\/httpdocs\/restoredirectory\/ --dry-run\n\n<\/pre>\n<p>The databases are in \/mnt\/olddrive\/var\/lib\/mysql<\/p>\n<p>One thing you might try is to stop mysql, change datadir in \/etc\/my.cnf to \/mnt\/olddrive\/var\/lib\/mysql, then restart mysql and dump your databases. Then stop mysql, revert datadir back and restart mysql again.<\/p>\n<p>When MySQL is running using the slaved drive as the datadir, you can use this to log in to MySQL:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nmysql -uadmin -p`cat \/mnt\/olddrive\/etc\/psa\/.psa.shadow\n\n<\/pre>\n<p>alternately you can set skip-grant-tables in the \/etc\/my.cnf file until you have things running again.<\/p>\n<p>You can either dump your databases as one file or as separate files for each DB &#8211; <a href=\"http:\/\/www.commandlinefu.com\/commands\/view\/2916\/backup-all-mysql-databases-to-individual-files\" target=\"_blank\" rel=\"noopener\">http:\/\/www.commandlinefu.com\/commands\/view\/2916\/backup-all-mysql-databases-to-individual-files<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>First you will want to set up subscriptions for the domains in the plesk panel. Once they are created you can run the commands below: Here are a few commands that should help. 1.) rsync example. This will move the data from one drive to the other. rsync -avz \/mnt\/slave\/var\/www\/vhosts\/&quot;domain name&quot;\/httpdocs \/var\/www\/vhosts\/&quot;domain name&quot;\/httpdocs You will &#8230; <a title=\"Move Data from Slaved Drive &#8211; Plesk\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/06\/27\/move-data-from-slaved-drive-plesk\/\" aria-label=\"Read more about Move Data from Slaved Drive &#8211; Plesk\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66,70,86],"tags":[],"class_list":["post-334","post","type-post","status-publish","format-standard","hentry","category-migration","category-mysql","category-plesk"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=334"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/334\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}