This happens sometimes after migrating from one host to another. The problem boils down to a permissions issue. If you copied the uploads
folder to the new server via an ssh connection sometimes the owner of the files copied will be whoever you connected with to perform the copy.
If you want to confirm that this is in fact the issue you can run:
$ ls -ld /var/www/html/wp-content/
and you may see something like:
`
drwxr-xr-x 5 root root 4096 Feb 11 08:29 /var/www/html/wp-content/`
Which says that root is the owner because that is the user that copied the file onto the server, even though for WordPress to write to the folder, the owner needs to be www-data
. This issue can easily be fixed by issuing the following command:
$ sudo chown -R www-data:www-data /var/www/html/wp-content/
Now the owner will be www-data
and you will be able to upgrade files again! Happy WordPressing!