IT/Procedures/Website Copying: Difference between revisions
(added the website) |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Copying or moving a Website to a different domain takes several steps which are listed here. | Copying or moving a Website to a different domain takes several steps which are listed here. | ||
These steps assume that everything is done on one machine. If the website should be copied/moved to a different domain | These steps assume that everything is done on one machine. If the website should be copied/moved to a different domain and a different machine, combine the steps here with those in [[IT/Procedures/Website Moving| Website Moving]] | ||
=== Westhost and Zoneedit === | === Westhost and Zoneedit === | ||
Line 12: | Line 12: | ||
<code> sudo mkdir FOLDERNAME </code> | <code> sudo mkdir FOLDERNAME </code> | ||
<code> sudo cp /var/www/html/OLDFOLDERNAME /var/www/html/NEWFOLDERNAME </code> | <code> sudo cp /var/www/html/OLDFOLDERNAME /var/www/html/NEWFOLDERNAME </code> | ||
Latest revision as of 09:26, 22 February 2022
Copying or moving a Website to a different domain takes several steps which are listed here.
These steps assume that everything is done on one machine. If the website should be copied/moved to a different domain and a different machine, combine the steps here with those in Website Moving
Westhost and Zoneedit
First of all one has to create the domain the website is going to be on and change the settings the way they should be.
Files
Create a new folder for the files of the "new" website, and copy all the files from the old website there. Make sure the ownership and permissions are correct. The easiest way to do it is as follows:
sudo mkdir FOLDERNAME
sudo cp /var/www/html/OLDFOLDERNAME /var/www/html/NEWFOLDERNAME
Database
To copy the database open Phpmyadmin and follow the following steps:
- select the database of the "old" website
- then select the "Operations" tab
- go to "Copy database to:"
- enter the new name
- select "structure and data"
- Check "CREATE DATABASE before copying" and "Add AUTO_INCREMENT value."
- Click "Go"
After this (when using Wordpress, other programs probably have something like that too), go into the new Database and open "wp-options" and change all the name and url of the old website to the name and url of the new one.
source: https://my.justhost.com/cgi/help/how-to-copy-a-database-using-phpmyadmin
Vhost files
see for more details: Website Moving
In "wordpress.conf" copy the section of the old website and change all the references from the old to the new website.
In "wordpressSSL.conf" copy the section of the old website and change all the references from the old to the new website. Then delete the SSL certificate part in order to install a new one. To do so use:
sudo service apache2 restart
sudo apache2ctl configtest
sudo certbot
This should show a list of all the websites on the machine and ask for which one a certificate should be made. Select the new website and proceed. After that check whether a certificate was added to "wordpressSSL.conf".