{"id":658,"date":"2021-07-23T12:34:58","date_gmt":"2021-07-23T12:34:58","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/full-disaster-recovery\/"},"modified":"2021-07-23T12:34:58","modified_gmt":"2021-07-23T12:34:58","slug":"full-disaster-recovery","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/full-disaster-recovery\/","title":{"rendered":"Full Disaster Recovery"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\">\n<div id=\"versioned-article-header\">\n<p class=\"valid-version-info\"><em>Valid for versions 94 through the latest version<\/em><\/p>\n<\/div>\n<div id=\"version-select-group\" aria-label=\"select versions\">\n<h4>Version:<\/h4>\n<h4>82<\/h4>\n<h4>94<\/h4>\n<\/div><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li><strong>Only<\/strong> experienced system administrators should use the procedures in this document.<\/li>\n<li>cPanel, L.L.C. <strong>cannot<\/strong> support failed hard drives or hard drive recovery. We are <strong>not<\/strong> responsible for any data loss.<\/li>\n<\/ul><\/div>\n<\/div>\n<p>In some circumstances, you may need to completely restore your server from a crashed or failed hard drive.<\/p>\n<h2 id=\"prepare-to-restore-your-server\">Prepare to restore your server<\/h2>\n<p>If you have recent remote backups and can\u2019t boot the failed hard drive, you can proceed to rebuilding your server.<\/p>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>If you don\u2019t have recent remote backups, we strongly recommend that you rework your backup strategy to store regularly-scheduled backups in a remote location.<\/p>\n<\/p><\/div>\n<\/div>\n<p>If you <strong>don\u2019t<\/strong> have recent remote backups but <strong>can<\/strong> boot the failed hard drive, perform one of the following actions:<\/p>\n<ul>\n<li>If you <strong>can<\/strong> access WHM from the failed hard drive, create a backup with WHM\u2019s <em>Backup Configuration<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Backup &gt;&gt; Backup Configuration<\/em>).<\/li>\n<li>If you <strong>can\u2019t<\/strong> access WHM from the failed hard drive, run the <code>\/usr\/local\/cpanel\/scripts\/pkgacct<\/code> script.<\/li>\n<\/ul>\n<p>After you complete the backup procedure, transfer the backup files to a remote location.<\/p>\n<h2 id=\"rebuild-the-server\">Rebuild the server<\/h2>\n<p>Some data centers and hosting providers offer system restoration and imaging. Contact your hosting provider for more information.<\/p>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li>The replacement cPanel &#038; WHM server should contain identical software to the original server. This includes MySQL\u00ae or MariaDB\u00ae, PHP, PHP extensions, Apache\u00ae, Apache extensions, and other software options. If you do not use the same version of MySQL or MariaDB on the new server, you may encounter serious errors.<\/li>\n<li>If you wish to update any of the software on the server, we <strong>strongly<\/strong> recommend that you perform the transfer or restoration first and then perform any updates.<\/li>\n<\/ul><\/div>\n<\/div>\n<h3 id=\"manually-provision-the-new-hard-drive\">Manually provision the new hard drive<\/h3>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li>If you use an ISO, get it from the operating system\u2019s official mirrors. Third-party drive images may cause unexpected problems.<\/li>\n<li>If you use CentOS, we <strong>strongly<\/strong> recommend that you use the CentOS Minimal ISO.<\/li>\n<\/ul><\/div>\n<\/div>\n<p>To manually provision the new hard drive, perform the following steps:<\/p>\n<ol>\n<li>Install a new hard drive as the primary hard drive and make the old hard drive the secondary hard drive.<\/li>\n<li>Install the operating system. For more information, read our Installation Guide documentation.<\/li>\n<li>Install cPanel &#038; WHM with the following commands:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">cd \/home\ncurl -o latest -L https:\/\/securedownloads.cpanel.net\/latest\nsh latest<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<h3 id=\"request-a-new-hard-drive-and-image\">Request a new hard drive and image<\/h3>\n<p>Make sure to request that the data center installs your old hard drive as a secondary drive. After they finish this, perform one of the following actions to update cPanel &#038; WHM to the latest version:<\/p>\n<ul>\n<li>Run the <code>\/usr\/local\/cpanel\/scripts\/upcp<\/code> script.<\/li>\n<li>Use WHM\u2019s <em>Upgrade to Latest Version<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; cPanel &gt;&gt; Upgrade to Latest Version<\/em>).<\/li>\n<\/ul>\n<h2 id=\"recover-your-files\">Recover your files<\/h2>\n<p>If you don\u2019t have a recent remote backup and can\u2019t boot the failed hard drive on your server, you can proceed to restoring your files.<\/p>\n<p>In all other scenarios, perform the following steps as the <code>root<\/code> user to recover your files:<\/p>\n<ol>\n<li>Mount the secondary drive in a <code>chroot<\/code> environment. To do this, run the following commands, where <code>sdb1<\/code> represents the device name of your secondary drive:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">mkdir \/mnt\/chroot\/\nmount \/dev\/sdb1 \/mnt\/chroot\/<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>You <strong>must<\/strong> mount the drive and partitions before you can bind mount the filesystems.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<li>Mount the <code>proc<\/code>, <code>dev<\/code>, and <code>sys<\/code> filesystems in a <code>chroot<\/code> environment. To do this, run the following commands:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">mount --bind \/proc \/mnt\/chroot\/proc\nmount --rbind \/dev \/mnt\/chroot\/dev\nmount --bind \/sys \/mnt\/chroot\/sys<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<p>We use the <code>rbind<\/code> command instead of the <code>bind<\/code> command for the <code>dev<\/code> directory in order to ensure that we mount the <code>\/dev\/pts<\/code> partition properly.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<li>Run the <code>grep chroot \/etc\/mtab<\/code> command to verify that the system properly mounted each filesystem. Your results should resemble the following output:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">4\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">\/dev\/sdb1 \/mnt\/chroot none rw,bind <span style=\"color:#ae81ff\">0<\/span> <span style=\"color:#ae81ff\">0<\/span>\n\/mnt\/chroot\/proc \/proc none rw,bind <span style=\"color:#ae81ff\">0<\/span> <span style=\"color:#ae81ff\">0<\/span>\n\/mnt\/chroot\/dev \/dev none rw,bind <span style=\"color:#ae81ff\">0<\/span> <span style=\"color:#ae81ff\">0<\/span>\n\/mnt\/chroot\/sys \/sys none rw,bind <span style=\"color:#ae81ff\">0<\/span> <span style=\"color:#ae81ff\">0<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>Run the <code>screen<\/code> command to start a <code>screen<\/code> session. This lets you use the <code>chroot<\/code> environment in a session that you can reconnect to if you lose your connection. Disconnections from sessions with <code>chroot<\/code> environments can cause problems for services such as MySQL, which may experience InnoDB issues.<\/li>\n<li>Run the following commands to let the system perform as if you booted into the crashed drive:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">chroot \/mnt\/chroot \/bin\/bash -l\nexport PS1<span style=\"color:#f92672\">=<\/span><span style=\"color:#e6db74\">\"{chrooted}<\/span>$PS1<span style=\"color:#e6db74\">\"<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<p>Your results should resemble the following output:<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"color:#f92672\">{<\/span>chrooted<span style=\"color:#f92672\">}<\/span>bash-4.1#<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Run the <code>source \/etc\/environment && source \/etc\/profile<\/code> command to recover the cPanel &#038; WHM environment.<\/li>\n<li>To start required services from the old hard drive, run the necessary commands to start any services that the <code>\/usr\/local\/cpanel\/scripts\/pkgacct<\/code> script will require. For example, you will need the MySQL service for Webmail databases, or the PostgreSQL\u00ae service if you use that database service.\n<ul>\n<li>If your server runs CentOS 6, run the following command:\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">service mysql start<\/code><\/pre>\n<\/div>\n<\/li>\n<li>If your server runs CentOS 7 or 8, run the following command:\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">test -f \/etc\/sysconfig\/mysql <span style=\"color:#f92672\">&&<\/span> source \/etc\/sysconfig\/mysql; \/usr\/sbin\/mysqld --daemonize --user<span style=\"color:#f92672\">=<\/span>mysql --pid-file<span style=\"color:#f92672\">=<\/span>\/var\/run\/mysqld\/mysqld.pid <span style=\"color:#e6db74\">${<\/span>MYSQLD_OPTS<span style=\"color:#e6db74\">}<\/span><\/code><\/pre>\n<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li>To start <code>dnsadmin<\/code>, run the following command:\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">\/usr\/local\/cpanel\/libexec\/dnsadmin-startup --start<\/code><\/pre>\n<\/div>\n<\/li>\n<li>To back up accounts from the old hard drive, run the following commands. These commands store the backups in the <code>\/mnt\/chroot\/home<\/code> directory and also stores the feature lists and packages settings:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">cd \/var\/cpanel\/users\n<span style=\"color:#66d9ef\">for<\/span> i in <span style=\"color:#e6db74\">`<\/span>ls -1 *<span style=\"color:#e6db74\">`<\/span>; <span style=\"color:#66d9ef\">do<\/span> \/scripts\/pkgacct --skipdnszones $i; <span style=\"color:#66d9ef\">done<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>We <strong>strongly<\/strong> recommend that you do <strong>not<\/strong> use the <code>rsync<\/code> command to back up accounts. This may cause issues with services such as MySQL.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<li>To back up service configurations from the old hard drive, run the following commands:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">cd \/usr\/local\/cpanel\nbin\/cpconftool --modules<span style=\"color:#f92672\">=<\/span>cpanel::smtp::exim,cpanel::system::backups,cpanel::system::mysql,cpanel::system::whmconf,cpanel::easy::apache,cpanel::ui::themes --backup<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<p>The results will resemble the following output:<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">Backup Successful\n\/home\/whm-config-backup-configuration__to__backup-10.550000-1452006507.tar.gz<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>Transfer backup files to remote storage. Use the <code>scp<\/code> command or the <code>rsync<\/code> command to copy the files to a remote storage location.\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>You can directly transfer the files from the old hard drive to the new hard drive. However, we <strong>strongly<\/strong> recommend that you transfer them to a remote location first. This protects your backup files from hardware issues that may have caused the hard drive to fail.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<li>Run the following commands to stop all services in the <code>chroot<\/code> environment, unmount the filesystems, and exit the <code>chroot<\/code> environment:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">service mysql stop\numount <span style=\"color:#f92672\">{<\/span>\/proc,\/dev,\/sys<span style=\"color:#f92672\">}<\/span>\nexit<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>To close the <code>screen<\/code> session, run the <code>exit<\/code> command.<\/li>\n<\/ol>\n<h2 id=\"restore-your-files\">Restore your files<\/h2>\n<p>To restore the content from the backup files to your new hard drive in the server, perform the following steps as the <code>root<\/code> user:<\/p>\n<ol>\n<li>Run the <code>scp<\/code> command or the <code>rsync<\/code> command to copy the files from the remote location to the new hard drive.<\/li>\n<li>To restore feature lists to the server, run the following commands:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">cd \/backups\ntar -xzvf _var_cpanel.tar.gz var\/cpanel\/features tar -xzvf _var_cpanel.tar.gz var\/cpanel\/features<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>To restore accounts to the server, run the following commands, where <code>BACKUPDIRECTORY\/TYPE\/DATE\/<\/code> represents your backup directory:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">cd BACKUPDIRECTORY\/TYPE\/DATE\/accounts\/\n<span style=\"color:#66d9ef\">for<\/span> archive in <span style=\"color:#e6db74\">`<\/span>ls<span style=\"color:#e6db74\">`<\/span>; <span style=\"color:#66d9ef\">do<\/span> \/scripts\/restorepkg $archive; <span style=\"color:#66d9ef\">done<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<div class=\"callout callout-cpanel\">\n<div class=\"callout-heading\">More:<\/div>\n<div class=\"callout-content\">\n<p>For more information, read our The <code>restorepkg<\/code> Script documentation.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<li>Run the <code>\/usr\/local\/cpanel\/bin\/cpconftool<\/code> script to restore the configuration settings for Apache, backups, cPanel themes, Exim, MySQL, and WHM to the server.<\/li>\n<li>If you run CloudLinux\u2122, restore CloudLinux settings to the server.<\/li>\n<\/ol>\n<h2 id=\"test-the-server\">Test the server<\/h2>\n<p>Test the websites, applications, and services on the new server. Make certain that you have successfully restored the server\u2019s data and configuration.<\/p>\n<h2 id=\"reconnect-to-a-screen-session\">Reconnect to a screen session<\/h2>\n<p>To reconnect to a <code>screen<\/code> session, perform the following steps as the <code>root<\/code> user:<\/p>\n<ol>\n<li>Run the <code>screen -ls<\/code> command to list your active sessions. Your results should resemble the following output:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">4\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">There are screens on:\n    <span style=\"color:#ae81ff\">12565<\/span>.screen1   <span style=\"color:#f92672\">(<\/span>Detached<span style=\"color:#f92672\">)<\/span>\n    <span style=\"color:#ae81ff\">12568<\/span>.screen2   <span style=\"color:#f92672\">(<\/span>Detached<span style=\"color:#f92672\">)<\/span>\n<span style=\"color:#ae81ff\">2<\/span> Sockets in \/var\/run\/screen\/S-root.<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>Run the <code>screen -x screenname<\/code> command to reconnect to the session, where <code>screenname<\/code> is the session\u2019s name.<\/li>\n<\/ol><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Valid for versions 94 through the latest version Version: 82 94 Overview Warning: Only experienced system administrators should use the procedures in this document. cPanel, L.L.C. cannot support failed hard drives or hard drive recovery. We are not responsible for any data loss. In some circumstances, you may need to completely restore your server from &hellip;<\/p>\n","protected":false},"author":1,"featured_media":659,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/658"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=658"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/658\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/659"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}