When you are frequently working with WordPress installations, it is common to be migrating servers from and to different providers or registars. Some customers also like to change the URL or maybe add https support to the current backup. To explain this a little better I want to describe a migration from an old URL to a new URL as shown: Old url: http://myoldurl.com/ New url: https://newweb.com/ You usually start restoring the data backup in a database and set the old WordPress files into the original structure from the last installation, but when you try to open the website (in this case https://newweb.
When you need to handle MySQL databases, it is useful to have a tool which lets you create backup files and also restore them properly; this can be achieved by using mysql and mysqldump commands in the command line. To be able to use them, you have to make sure the user you will use has the privileges to manage the database you are working with, we will be using root MySQL user to go through the examples.
There are multiple systems where you need to set up a new database, Installing MySQL is always an option to achieve that, but after installation, you will have to follow some more steps to be able to provide the connection credentials to the system you are trying to connect, let’s try it following the next steps: How to create a database? First check if you have MySQL installed, you can do it running the command:
Sometimes we need handy lines to be able to compress or extract files in the command line using different extensions, here are some useful lines to achieve it: Compress Files Depending on the file extension and compression technology you have to use a different command line tool. The most commonly used however is the tar.gz format. An example of creating a file with this extension is: tar -zcf filename.tar.gz foldername/ You can also create zip files using: