If you’ve started using WordPress pre-configured Bitnami VM Image then you’ll face Linux permission issues while migrating your WordPress site to other host. This article is specifically for permissions, if you’re looking for site migration tutorial I’m linking a very good article for WordPress site migration.
When you’ll run WordPress site migration plugins like “All-in-One WP Migration”, “Duplicator” and many others, you’ll face permission issues and will fail to migrate your site. If you have no idea what I am talking about, pictures bellow will give you a better idea.
See that? I installed “Duplicator” plugin to create a backup of my site, but it gave me error. Is it a plugin issue you asked? No! Not at all. Your OS should give read/write permission to PHP (WordPress plugins are written in PHP) for the specific user where your WordPress instance is installed. You can read more about Linux Permissions.
If you try to convince yourself that it’s a plugin issue then let me save some time for you, let me show you what error you’ll get in different plugin.
This error I got when I tried to make a backup of my site using “All-in-One WP Migration” plugin. So, let assign the permissions.
Connect to your VM using Git bash and write this command “chomd 775 WP_Instance_Path“.
775 give the read and execute access to anyone and write access to the owner of directory. On the other hand, 777 gives read, execute and write access to anyone.
After executing this command I was successfully able to create a backup using “Duplicator”.
But in “All-in-One WP Migration” I need to make a “../storage” directory manually because that plugin tries to make a directory and store backup over there, but it fails to make directory.
Other way of doing that is giving 777 permission to directory, but it isn’t safe.
Now, I was successfully able to export my WordPress site using “All-in-One WP Migration” too.
See, no errors at all. Now simply import your site to a new host.
WordPress site migration sometimes can be very frustrating, feel free to contact me if you face any issue.