Changing your site to a new accommodation can be a tedious process. You can compare it to change house or office . Fortunately, it is much faster than that. With these instructions you can migrate your website in a very short time minimizing the impact on your readers and search engines. Find out that will take you at most one day and even at the best one hour or less.
Get ready. Make sure you have the following.
One or more of these things will change during migration:
- IP Address: the Internet address of your web hosting. If your blog does not change servers, it is quite likely that the IP will not change either.
- Domain name : www.tunombredeblog.com . You may have acquired a new domain name. And maybe not. Now would be the perfect time for this type of change.
- Route : what comes out in the URL after the domain name, usually separated by a slash (/), or a sub-site, such as / blogs / yourname / ). Many blogs start as sub-sites in an existing domain, but eventually become their own sites, with their own domain.
Note how all of the above is currently. It also points the new addresses or elements as they will be after the change.
Do not forget the basics :
- If you change the web hosting IP address and access information for your new web hosting. Either by FTP or SSH.
- The management information of the database of your web hosting (s). Whether you use phpMyAdmin, a web hosting control panel, or command line, this information is crucial.
Do you have it? Ok, then we started. From now on you should not modify anything in your "old" blog. Do not accept more comments, pingbacks or trackbacks, do not publish more posts or upload more files. This can be easily controlled from your control panel.
Domain name preparation
Do this step only if you are going to keep your domain name ( www.miblog.com ), but you blog will change your IP address (eg in a new hosting company).
To do this successfully you need to take control of your domain name. You manage this with your DNS provider (and this is a good time to learn how to manage your DNS by yourself). Well, here are the steps:
- Record your TTL (the time-to-live, which is usually between 3600 or 86400 seconds).
- Decrease the TTL to 5 minutes.
- Now we have to wait. If your TTL was 86400 seconds (1 day), wait one day. Sit and take something.
The WordPress settings
Skip this step if you are not migrating to a new web hosting. Use your favorite FTP client to copy the WordPress files from your current hosting to the new hosting folder. All files mean all: uploaded files, plugins, everything in your WordPress folder. Make sure you keep the permissions of the files and folders while you move them – if, for example, the uploads folder had write permissions, moving it should result in a folder of uploaded files with write permissions on the server web of the destination accommodation. At this point, you may not yet have a domain name pointing to your domain, in this case you must use the IP address of the new hosting. Nothing happens.
The configuration of the database
Are you still here? Perfect.
- Using your favorite utility (usually phpMyAdmin) for database administration, create a new and empty one in the new hosting. If you are not going to change hosting do it anyway.
- Create a new username and password. Give the user enough privileges in the database.
Do not do more in this respect at the moment.
The transfer of contents
If your domain name and route are not going to change during the migration, skip this step
Now is the time to reconfigure the information in the database, so that your complete blog fits completely with your new URL. I recommend using WordPress AutoLink . You will use it to move all your posts automatically – replace all absolute URLs with references to the "slugs" (name of the URL). The result? Your posts will no longer point to old URLs. It greatly diminishes the possibility of broken links in your posts and comments, and will also facilitate the following steps. Try it out.
Normally this process is quite tedious since it involves editing the WordPress settings and all the hyperlinks in your posts, comments, plugin settings and blogroll. But there is a bombproof way to do it:
- Exports the database to a file. Using the database administration tool (usually phpMyAdmin) of your old hosting, export the entire database as a series of SQL statements.
- Download it to your computer.
- Open it in your favorite text editor
- Search for any match to the old address and change it to the new URL. All. You can try and use the automatic replacement of the editor (I do not recommend it) or do it one at a time and make sure you're changing.
You can even do it in the command interface of your operating system (Linux or Mac OS X ) with the following order
cat blog.sql | sed 's | http: // oldaddress / | http: // newaddress | g'> newblog.sql – but it may be too much for you, if you do not deal with UNIX commands. The best thing is that you do it with your web editor or plain text. You may still have some adjustment but it will depend on whether your posts refer to absolute routes (
/ route / to / some / post / ) instead of full URLs (
http: // tublog / route / to / post / ). In any case, your goal in this stage is to adjust the URLs in your content to point to the new place.
Oh, and to be sure, you should audit the changes using a tool that allows you to visualize the changes, be it the to be. Once you finish, send this modified SQL file to your newly created database in the new hosting
The domain change
There are two types of domain change:
- From www.viejadireccion.com towards www.nuevadireccion.com
- The domain is the same but the IP address changes
Obviously, if the domain and the IP do not change you skip this step.
If the IP address (that is, Web hosting) changes
Make the DNS change. In essence, what you have to do is make your DNS point to the new hosting. This takes a while – during the DNS change many servers continue to access the old site. After the TTL expires (time-to-live, which you changed to 5 minutes), this will change and your new site will be available.
After making the change, increase the TTL to something reasonable (yes, 86400 seconds is reasonable). This will prevent a future DNS request storm.
If you change your domain name
just have your new domain name point to the IP address of the new Web host. That is all. If you were not aiming at anything, it will be a short time until your new site is active, but if it was already directed to another site you will have to wait until the TTL expires.
Have you done everything? Do DNS work? Ok, now:
- Edit the famous file
wp-config.php and enter the information in the database, just like you did the first time you created your first blog.
- Enter the address of your blog in the browser.
Your blog should work.
Redirect 301: an important detail
At this point I will make a master suggestion: if you changed to the address of your blog (the route and / or the domain name) you should have the old address make permanent redirects from the old address to the new address.
This will not always be possible, since you can not control the web server configuration in the previous host, but It is important since both readers and search engines will be redirected to the new site. Oh, and remember to make redirects go to real pages. For example, if you had a post on http://viejadireccion.com/archivo/mi-post/ the redirection should go directly to http://nuevadireccion.com/archivo/mi- post / . Do not confuse your readers by redirecting them to the main page of your blog.
Tip: this is easily done through the configuration of the file
.htaccess . And if you do not know or do not dare you can use some plugin like one of these two .
You got it!