How to Migrate Drupal to AccuWeb.Cloud?
Drupal is a widely-used open-source content management platform powering millions of websites and applications. Supported by a vibrant global community, it offers robust features and flexibility. Let’s deploy Drupal on AccuWeb.Cloud with these straightforward steps:
Setting Up Your Environment
Log in to AccuWeb.Cloud
Step 1. Open your web browser and navigate to AccuWeb.Cloud
Step 2. Enter your credentials (username and password) to access your AccuWeb.Cloud dashboard.
Create a New Environment
Step 1. Click on the “New Environment” button at the dashboard’s top left.
Step 2. Choose Apache as the application server and PHP and MySQL for the database setup.
Step 3. Your environment, equipped with Apache and MySQL, will be created and visible in the environment list shortly.
Configure Apache Server
Step 1. Click on the Config button for your Apache server.
Step 2. Navigate to the ‘etc’ folder and open the ‘php.ini’ file.
Step 3. Insert the line extension=gd.so after the extension=mysqlnd.so line.
Step 4. Save your modifications and restart the node.
Backup Old Site
Step 1: Identify the Files to Back Up
- Drupal Core Files: These include the core Drupal files and directories.
- Custom and Contributed Modules: Located in the sites/all/modules (for Drupal 7) or modules (for Drupal 8/9) directories.
- Themes: Custom and contributed themes located in the sites/all/themes (for Drupal 7) or themes (for Drupal 8/9) directories.
- Sites Directory: This includes settings and uploaded files located in the sites/default directory.
- Custom Files: Any custom scripts or files outside the standard Drupal directory structure.
Step 2: Use FTP/SFTP to Download Files
- Install an FTP/SFTP Client: Popular options include FileZilla, WinSCP, and Cyberduck.
- Connect to Your Server:
- Open your FTP/SFTP client.
- Enter your server’s IP address, username, password, and port number (default is 21 for FTP and 22 for SFTP).
- Navigate to the Drupal Root Directory: Locate the directory where your Drupal site is installed.
- Download Files:
- Select all the necessary directories and files (as identified in Step 1).
- Download them to your local machine.
Export Database
Access phpMyAdmin
- Open your web browser and navigate to the phpMyAdmin interface (usually like http://yourdomain.com/phpmyadmin).
- Log in with your database username and password.
Select and Export the Database
- Select the Database: In the left-hand panel, select the database that your Drupal site is using.
- Export the Database:
- Click on the “Export” tab at the top of the page.
- Choose the export method:
- Quick: Exports the entire database with default options.
- Custom: Allows you to select specific tables and other options.
- Choose the format as SQL.
- Download the Database: Click the “Go” button. The SQL file containing your database will be downloaded to your computer.
Transfer Files and Database to AccuWeb.Cloud
1. Transfer Files
Method 1: Deploy Zip File from Local
Upload the downloaded .zip archive to the Deployment Manager.
Method 2: Using FTP
Use the FTP client to upload the files to your AccuWeb.Cloud environment.
2. Transfer Database
Method 1: Using phpMyAdmin
- Access phpMyAdmin:
- Open your web browser and navigate to the phpMyAdmin interface (usually like http://yourdomain.com/phpmyadmin).
- Log in with your database username and password.
- Create a New Database:
- Click on the “Databases” tab.
- Enter a name for your new database.
- Click “Create“.
- Import the Database:
- Select the database you just created in the left-hand panel.
- Click on the “Import” tab at the top of the page.
- Click on the “Choose File” button and select the SQL file that you exported from your old server.
- Ensure the format is set to SQL.
- Click the “Go” button to start the import process.
Method 2: Using MySQL/MariaDB Command-Line Tools
Access the Server via SSH:
Step 1. Open a terminal on your local machine.
Step 2. Connect to your new server using SSH:
ssh username@server_ip
Replace username and server_ip with your server’s username and IP address.
Create a New Database:
Step 1. Log in to MySQL/MariaDB:
mysql -u root -p
Replace root with your MySQL username (if different).
Step 2. Create the database:
CREATE DATABASE new_database_name;
Replace new_database_name with the name you want to give to your new database.
Step 3. Grant privileges (if needed):
GRANT ALL PRIVILEGES ON new_database_name.* TO 'db_user'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
Replace new_database_name, db_user, and password with your database name, database user, and user password respectively.
Step 4. Exit MySQL:
EXIT;
Import the Database:
Upload the SQL file to your server using scp:
scp /path/to/local/database.sql username@server_ip:/path/to/remote/directory
Import the database:
mysql -u db_user -p new_database_name < /path/to/remote/directory/database.sql
Enter the database user’s password when prompted.
Verifying the Migration
- Check Database Content: Verify that the tables and data have been correctly imported.
- Check Drupal Configuration: Ensure that the settings.php file in sites/default has the correct database connection information.
- Test the Site: Access your Drupal site to verify that it is functioning correctly.
Following these steps will help you successfully migrate your Drupal site to AccuWeb.Cloud. If you encounter any issues or need further assistance, feel free to reach out to AccuWeb.Cloud support or consult the Drupal community forums.