PDF migration

Question

  • Is there a method to migrate all PDF files?
    • Yes, you can export from phpMyAdmin
  • Is possible preserving the same paths?
    • Yes: with Export media plugin  using this method in will import all media files
    • Yes: Manually
    • Create Corresponding Paths: On your new site, create the same directory structure and paths as on the Kinstar site. This will ensure that the URLs remain consistent and functional.
    • Transfer PDF Files: Upload the PDF files from your Kinstar site to the corresponding paths on your new production site. You can use an FTP client.

Where are your pdf files stored?

Your media files are uploaded to the /wp-content/uploads/folder. Normally, the image is also placed inside a folder the month it was uploaded.

Where is data for your media files in the database?

Information about your WordPress pdf is stored in two database tables:

  • wp_posts: This table has one entry for each pdf, image. The entry contains the URL, caption, the upload date, and other key data.
  • wp_postmeta: This table contains multiple entries. These entries contain the image’s ALT text and information about different sizes of the image to show on different device sizes.

What is the post_mime_type value for PDF files?

The standard Media Type (formerly known as MIME types) is application/pdf

How to export pdf files?

				
					// SQL Browse

SELECT * FROM `wp_posts` WHERE `post_mime_type` LIKE 'application/pdf'
				
			

Prepare Import file

From CSV file you get all pdf as table. We have to combine its to one cell for one post. 

Edit file in the google spreadsheet

  • Add a new column in the left
  • =CONCAT("|", T2)
  • Enter the formula in T2, drag it down the column, and you will have the same text inserted in all cells.
  • Create a new sheet with title and attachment columns only.
  • Copy all values only paste into the attachment column.

Import file via WP import plugin

  • Import new post
  • Map fields
  • Title: title
  • Other Post Options: Download & Import Attachments 
    • Map with:  {attachment[1]}
    • Separate by ” | “
    • Check: Search for existing attachments to prevent duplicates in media library

Video

More Resources

Suggest solution from Kinstar support is use duplicate plugin but it doesn’t work on my case.