Skip to content

Instantly share code, notes, and snippets.

@AbudiMutamba
Last active December 14, 2022 13:50
Show Gist options
  • Save AbudiMutamba/9629cbc6e8fd7c28a0ac4b88fb941d30 to your computer and use it in GitHub Desktop.
Save AbudiMutamba/9629cbc6e8fd7c28a0ac4b88fb941d30 to your computer and use it in GitHub Desktop.
wordpress websitecopy
//Setting up database for WordPress in the a shared hosting enviroment
There are two scernarios:
1. When creating a brand new WordPress website using an app install on your server.
Don't need you to woe=rry because the WordPress installer in the panel will handle the creation of the database.
*Installers
- Installation
- Softacuulous
- Stock installer
2. When you;re restoring or migrating a website.
In this case you need the files and the database of the website you're restoring . The database is usually a file with the .sql extension because WordPress uses a
Rational Database Management System called MySQL or Mariadb.
The fiel is generated at the point of backing up the WordPress website.
So you need to upload and import it to make the restoration.
In Plesk, Cpanel, DirectAdmin and many other panels it's a simple process
Plesk
1. Acces the panel by logging in
2. Select the domain that will point at the website
3. In the domain area click databases and you will see the import button. Which you will click and select the file from your computer.
4. Create the database and it's credentials. i.e The database name, username and password. Ensure to note them somewhere because you will need after successful import of the database. They're required in the wp-config.php file of the website
5. Alternatively you can upload the export file to file manager, still in the domain area of the target website. A md choose the file from the file manager to import.
6. Depending on the dump authenticity you might need to manually edit the export file.sql
-It's recommended to comment the SQLlines that could be causing the trouble other than deleting them
7. Access the file manager and look for the wp-config.php file to edit and add the right database details.
DATABASE: admin_pccp
USER: pccpdatautauza
Password: Abb2r6*3
Create a subdomain or domain name.
Open the original domain and look for "website copying",
Set the target which is the domain name created where you will copy the content.
Go to the created domain and set the following;
Database by creating a copy and changing the wp-config that the username,database user ,database password.
"The above will help in the databases not to collide and look closely when assinging the datebase user and domain name."
Head to one of the database of the created domain name and look for php admin.
In phpadmin look for wp-options for home url and siteurl change them to anew domain created.
Wp salt
@AbudiMutamba
Copy link
Author

Steps to migrate
1- change the new flies to HTTP docs after creating a backup
2- change the config file ( database name password)
3- Assign the database
4- change the ULR site and home in PHP admin

@AbudiMutamba
Copy link
Author

AbudiMutamba commented Dec 14, 2022

How change the domain name using DNS

  1. Open the domain you want to change too.
  2. Click on hosting and DNS,
  3. Add a record with name of the new domain and IP address of the server
  4. Look for the old domain and change the primary address by clicking the hosting and DNS then hosting settings.
  5. Add the SSl certificate for both the new and old site

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment