Hello! I have not written here for a long time. I will try to write more often. Later I will devote more time to articles on earnings in the Internet. And now, as promised, an article about how to move a site from localhost to hosting.
About what Denver is and how to use it, read here.
Suppose you decide to make a website. You do not yet have a hosting (what is hosting?) And a domain (what is a domain?), Or you want to speed up the process of creating a website and spend less Internet traffic, so you make a website directly on your computer (on localhost) using the Denwer utility After the construction of the site is completed, you will need to register a domain (how to register a domain?) And buy hosting, link the domain to the hosting and transfer the site to the server (hosting). After that, the site will be available to other Internet users.
Consider the transfer of a site from Denver to hosting on the example of WordPress. In principle, the transfer of other CMS is not much different.
Now the points that need to be done:
1) First of all, you need to make a backup copy (backup) of the database. To make a backup: Launch Denver and enter phpMyAdmin (You can enter in the address bar of your browser: localhost Tools phpMyAdmin In the left column of phpMyAdmin, select the database that belongs to thesite that you transfer to the hosting.
phpmyadmin-1 Once you have selected a base, click on the “Export” tab and go to the export page.
Here you need to specify the export options. Select all the tables, just in case, add the instructions “DROP TABLE VIEW PROCEDURE FUNCTION”, and remove the instructions “IF NOT EXISTS”, tick the “Save as file” checkbox and it is advisable to pack the gzip database. See the picture:
After clicking on the OK button, the database dump will be copied to your disk.
2) Now you need to create a database on your hosting. In the web control panel (for example, in Cpanel) find a block of something like “Database” and click on “MySQL Database Wizard”. First, you will be asked to enter the database name:
In the second step, you will be prompted to create a new user for the database. If you already have a user, then you can stop at this, go to the“MySQL Databases” and “Grant user access to the database” by selecting all the privileges. If there is no user yet or just want to create a new one, we are doing the second step:
Remember or write down the data on the database user, they will still be useful to you.
In the third step, we select all the privileges and proceed to the next step:
After that you will write something like:
“The user cereal00_9seo has been added to the base cereal00_vit.”
3) Now you need to import a dump of your database into the database created in the third step. To do this, go to phpMyadmin hosting. Select your database in the left column. Go to the tab “Import”, select the file with the database dump (backup), which turned out in the second step, and click the OK button.
After that, your database will be filled with tables and everything should be ok.
4) The database was transferred, now it is necessary to change all the old url (links) to new ones. To do this, go to the “SQL” tab in phpMyAdmin and in the input field enter requests that you need to adjust a little for yourself. http: denwerhost– link to Denver host, http://newdomain.ru link of the new domain
That is, if my site opens on Denver like this: http: cms1, then I insert it instead of http: denwerhost.
5) Now you need to transfer the CMS files. To do this, go to your hosting FTP. It is very convenient to use for this FTP clients programs such as: FlashFXP, CuteFTP, AceFTP and others. I am using FlashFXP.
Data for access to ftp should have been sent to you by a hoster in a letter (an example of a letter from the hoster with an explanation).
Next you need to upload all the files from your computer from the www folder to the hosting in the root of the site. The root is most often the www or public_html folder.
6) Now you need to “bind the database” to the engine. To do this, you need to edit the file that contains the database settings. In WordPress, this file is wp-config.php. The file must be opened in one of the editors that allow you to work with UTF-8 encoding WITHOUT BOM. I use Notepad You cannot edit wp-config.php in a simple notebook, as there will be errors later.
Change the database settings in this file, namely: The name of the database; MySQL username; and password;
All these data you remember “on point 2”.
After editing, save the file and fill it with