- This topic has 2 replies, 2 voices, and was last updated 1 year, 5 months ago by .
I am working on re-creating a records database using MB Custom Table. The original database was from a custom site (not WordPress), and I have a CSV export of all the data from the original SQL database.
I have created a custom post type for the records and am able to all save data from custom fields into the database. From the tests I have done, I am able to import most of the existing data into the site through the SQL database, so that part is working great. However, I am having trouble figuring out how to import the images affiliated with each record, since they are serialized in the database.
In the CSV of data from the original site, the image file name is listed for each record. For example: '2429.JPG'. Originally, I was thinking I could add this data, upload the images to WordPress, and then build the url in the WordPress structure (i.e. '/wp-content/uploads/2020/07/' + '2429.JPG') to display the images. From a backend approach, I think I could make this work (even though it is a bit hackish), but going forward I was planning to have the images uploaded through the Meta Box image field, which serializes the data...so I am back to square one. A couple of questions:
- Is there a way that I can import the images from the original database into the custom table (without manually uploading and entering all of them)?
- Thinking about longevity, if I ever need to export this database to be used outside of WordPress, would I be able to extract the file name out of the serialized image data? If so, how?
I do primarily front-end dev, so I am not very knowledgable on a lot of this database work. Everything with your plugins so far has been straightforward to use for my skill level in helping to set this up. Appreciate any insight you can give to point me in the right direction!
- You must be logged in to reply to this topic.