Skip to main content

[UPDATE] How to move your wordpress site and mysql database from local XAMPP to the web server


Most web developers follow the way of "first local, then on the server" for their website's early development or setup stages in order to gain either speed or freedom in installing pluging and extensions due to servers' permissions for files and folders.

A small problem comes around when you need to move your site from your local environment ( commonly XAMPP ) to your webserver so your website can go "live". This article will let you know the steps you need to follow when it comes to Wordpress and moving if from local to yuor server.

Before we start, you will need to :

1. have the url, username and password of your hosting environment's management panel ( cPanel or Plesk e.t.c. ) and log into it.
2. in your hosting panel, you need to add FTP access to your site, you will need to jot down the IP or domain name ( depending on DNS ), a username and a password
3. you will need to go into your hosting's database management via your management panel, create a new database ( for wordpress this is mysql ), name it, add a username and a password and jot all of those down, we will need them soon.
4. go to your hosting panel's mail settings and add a mail account for your site, i.e. noreply@mysite.com and jot down the address and its password, along with its POP and SMTP mail server addresses.

Now we can start.

Step 1 - Zip your files and upload the zipped file, then de-compress on-server

You will see that if you select all the files of your website ( thus the contents of c:/xampp/htdocs/mysite/ ) to an archive, the size will decrease significantly. In such manner, we are to zip the files in our local environment, upload the file to the server and then de-compress or un-zip those over there, mainly to gain bandwidth and time. Its not that wise to wait for 100 Megabytes to be uploaded ( containing a lot of very small files which tend to stall the transfer ) when we can upload for instance 60 Megabytes of just one file. Of course, there may be a chance that our zip file is uploaded badly and we may need to re-upload, but that is rare.

To upload our files to the server, we will need an FTP application. Yes, there is an option to transfer our file via the browser's upload function through our hosting panel ( i.e. cPanel or Plesk ) but its better to do this via the FTP application so we will not have to face timeouts and small network hickups that can break our transfer. The most common application for FTP ( we will need to have FTP access credentials ) is FileZilla. One thing to note about filezilla is to never store the passwords as this can cause us very very serious problems...

Here is how to disable password saving in FileZilla ( its called Kiosk Mode ) , open Filezilla and go to Edit->Settings then follow the image below :


Ok, after you have the FTP credentials we mentioned earlier, you will need to fill them in at the top site of filezilla as you can see below :


Once you click "Quickconnect" you will see the window blow this bar, to start loading files and folders. You will need to transfer your zipped file onto your webserver, preferably in the htdocs or www or root folder and wait until this is uploaded.

Once the file is uploaded, you will need to visit your hosting panel's file manager and go to that same folder, select the file that you've just finished uploading and de-compress it.

Step 2 - Upload the database via phpmyadmin

Wordpress is accompanied by a database which is implemented in mysql. You will need to go to your http://localhost/phpmyadmin and in the list of your databases to your left, select the database that refers to your site and click "Export" as you can see in the image below :


Now, you need to visit the same tool up onto your web hosting panel, there is a phpMyAdmin there too, your hosting provider has given you the address, or you can visit phpMyAdmin on your server via going in to visit the web panel for your database, the one you created online just before we started. When you visit the panel, you will need to do the reverse step, upload the file you got from the export.

In your webserver's phpMyAdmin, you will select the database from the list to your right and then ( careful you must select your database first ) select "Import" then you will select the file ( .sql file ) you got before and upload. Then the database and the data will be restored.


Step 3 - Update your configuration file

You will need to open up your webserver's file manager and go to your site's root folder, then open and edit the file named "wp_config.php" which contains the settings for your site and how it connects to your database. You will need to change the settings here to match your webserver's settings, those you've set up just before we started.



Step 4 - Update database tables and settings

When starting with wordpress locally, all the local-specific settings are bound into the database. For instance, your site's homepage address will be http://localhost/mysite which is ok for local but will never work on your webserver. We need to change such settings via the webserver's phpMyAdmin tool and here is how.

UPDATE : before running manual commands, you can try and download a tool titled "Database Search and Replace" from interconnectit here, unzip it in your wordpress root and then after you update your wp-config file with the information of the new live database, run the url of the replace tool and it will replace everything in your database for you. Its pretty slick and working great. There are two versions, one based on AJAX and one based on simple PHP, if the first does not work for you, you can try the basic one. 

Step 5 - You are there

If things went alright, then your site is now live. Here you can make a very common mistake. To see if things are fine, either view your site via another computer or remember to stop XAMPP before you test. Why is this important? Because you may have forgotten to update the database correctly and your browser will ask data from /localhost/ instead of the live site and thus, you will be the only one to see those...
Enhanced by Zemanta

Comments

Popular posts from this blog

Enable AMD's Radeon Chill feature for all games.

Since 2014 AMD has been following the tradition of releasing new performance and usability features in their December driver, and 2016 was no exception. Among the myriad of new features and enhancements, was also one that passed almost unnoticed, called Radeon Chill.

Stemming from AMD's acquisition of HiAlgo earlier in 2016, it offers the possibility of huge power and thermal savings while gaming, by monitoring screen movement and adjusting the frame rate accordingly. There is even the claim that it could also reduce response times since the GPU is not occupied with rendering as often.

Its only issue: it's not global, and it's based on a white list of applications to function. But fear not, for we are here. Using a trick as old as operating systems themselves, you can try to make it work with every title. Let's see how to do that.
Step One: Activate Radeon Chill. Doing that is fairly easy. Right click on your desktop and select "Radeon Settings":

Then naviga…

How to create a simple Facebook page cover photo with Inkscape

Inkscape is a free, open source application via which you can create vectory graphics. You can also use Inkscape to create your facebook page main graphics such as the logo and the cover photo, maybe also some images to highlight and assign as album covers.

In order to create your first Facebook cover photo for your page, first open us inkscape :


Second, go to File-> Document Properties and assign the canvas size to match the Facebook cover photo size in pixels, as below :


Next, you can add a rectangle to your cover and some text, via the tools to your left, the mail tool bar of Inkscape as you can see in the next two images : 
 Once you are done with your cover, you can save it :


Remember that you can save this as png which is something Facebook can "understand" and also it would be wise to save this as "Inkscape SVG" which is a native form of Inkscape file type which you can open again later via Inkscape and be able to edit it. 
Then, you can change your cover…