Revert your DV to default


  • Applies to: DV 4.0
    • Difficulty: Easy
    • Time Needed: 20
    • Tools Required: SSH, root access, developer tools
  • Applies to: DV
    • Difficulty: Easy
    • Time Needed: 20
    • Tools Required: SSH, root access, developer tools
  • Applies to: DV Developer
    • Difficulty: Easy
    • Time Needed: 20
    • Tools Required: SSH, root access, developer tools

Overview

This article outlines the process of reinstalling your DV server to bring it back to a default state. The DV product includes the functionality to do this from within your Plesk Control Panel. You can also reinstall from the Advanced Recovery Tools section of your Account Center's DV Control Panel. We will cover both methods in this article.

Before you start

This article has the following dependencies:

  • Whenever installing third-party software, please consult the official documentation. (mt) Media Temple does not support the installation and configuration of software not installed at time of service activation. Please consult our DV Scope of Support page for further explanation.
  • The domain example.com is used as an example. Please be sure to replace this text with the proper information for your site or server.

Method 1

Using the Account Center Advanced Recovery Tools

This tool will revert your DV to the default state, just like when you first provisioned the server. This will essentially wipe your server and save all of your old data inside of the /old directory on your server. You can only perform an Archive & Reinstall through the Account Center controls.

Instructions

  1. From the DV admin page in your Account Center, select Advanced Recovery. This is located in the Additional Tools menu.
    829_cp_advrecovery_1
  2. Click the Revert to Default button to begin the re-installation process.
    829_reverttodefault
  3. Create new passwords for both the root user and the admin/Plesk user. You will need these when you login to Plesk again, after the Revert to Default is finished.  After you have entered the new passwords, click the Revert to Default button.
    829_revert_newpasswords
  4. Confirm the action, making note of the directory into which your old contents will be placed.
    829_revert_confirm
  5. Wait approximately 15-60 minutes for the process to complete. Depending on how much data you have, the time to complete can vary. The page will show you that it is Pending and will let you know when it has Completed.

Method 2

Using the Plesk/Virtuozzo Reinstall VPS Menu

  • Log into your Power Panel.


    Power Panel

  • Click on Maintenance.
  • Click on the Reinstall tab. If your server is currently running, you will be prompted to stop it before proceeding.
  • Once your server has stopped, click the "Prepare to Reinstall" button.
  • Follow the prompts to continue and make your choices as needed.

NOTE:

  • We strongly encourage changing the root password for your new install after your VPS reinstall is complete using our Account Center tool.
  • If you change your root password via SSH, these tools will not save that password for the reinstall. Please use the Account Center tool to reset your root password. This would be one important step to prevent your server from being compromised moving forward, in case that was the reason for your reinstall.

Restoring Databases After Reverting

NOTE:

The following guide will help you restore your databases from the raw MySQL files that are created after you revert your server to default. While these instructions are usually successful, this process is not fully supported by (mt) Media Temple. Please proceed at your own risk.

  • Log into SSH as root.
  • Run the following command:
     
    
     service mysqld stop
    
       
  • Start up MySQL on a new socket.
     
    
     /usr/libexec/mysqld --user=mysql --socket=/var/lib/mysql/mysql.sock --basedir=/usr --datadir=/restore/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --skip-grant-tables
    
       

NOTE:

That command specifies "/restore/var/lib/mysql" as the path to the raw MySQL files. If they are located somewhere else, you will need to replace this path.

  • MySQL is now running on the server from the data directory you gave it. You will need to open a new SSH window, leaving this one open as well.
  • Make a new directory for your data.
     
    
     mkdir /root/sql_dumps
    
        
  • Create a list of all the databases.
     
    
     mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -e "show databases" | grep -v "information_schema" > /root/sql_dumps/db_list
    
        
  • Dump the databases on your list.
     
    
     for i in `cat /root/sql_dumps/db_list`; do mysqldump --add-drop-table -uadmin -p`cat /etc/psa/.psa.shadow` $i > /root/sql_dumps/$i.sql; done;
    
         
  • Stop MySQL.
     
    
     service mysqld stop
    
         
  • Start MySQL.
     
    
     service mysqld start
    
         
  • All of the databases are now in /root/sql_dumps/ on your server.

When restoring databases, DO NOT import the psa.sql database from your backup files to your newly restored server. The psa database is the internal database for Plesk. If this is restored and overwrites the current version, it will cause issues with your Plesk administration panel.