I'm working on a news site that has content since 2001, and I'd like to get all posts and their featured images. However, it has a quirk, I need to have the posts and their images in the database without having to download them because they are in a blob.
How do I get this result? Should I manually copy from the database? Is there any change I have to make?
If you are going to do the current website in wordpress, I recommend to create contents in wordpress way only. These steps can be followed.
Connect to the old website db from wordpress using wpdb
Query the required contents from the old website to WordPress.
file_put_contents('/path/to/new/file_name', $my_blob);
This can be executed in a loop depending upon your requirement.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.