Wordpress uploads error - is not writing to database [closed]

I've recently moved my WordPress blog from one server to another, changing the URL paths. I decided to use a subdomain for images and uploads.

After I upload an image I get this error:

"An error occurred in the upload. Please try again later."

I changed URL paths in the database so all the existing uploads are showing as expected. The new uploads will be uploaded in /static/uploads separated by year and month.

The image is not added to the database. After several attempts to upload I went to the uploads directory via FTP and confirmed the uploads were present, but for some reason they were not written to the database.

I would like to correct this so the uploads are both written to the server and the database.

I don't have example code or otherwise and didn't get a chance to review error logs.

Any fix or help will be very appreciated. Thanks!

If you still have a copy of the old database, try replacing the old domain or URL with a new one by fixing the serialized data as well as the paths.

A serialized string not only stores the value of a object but also its size (number of characters) therefore if the old and the new domains or URLs have different character counts, PHP will not be able to recreate the original object anymore.

WordPress Serialized PHP Search and Replace

What Others Are Reading