Migrating the media files from one wordpress site to another - wordpress

I'm moving a wordpress site from one hosting provider to another. I copied the media files from the folder wp_content/upload from the source site to the destination. I see that the files are there in the upload folder.
I did an export of all the content from the source site. Then I imported into the destination one. This carried over categories etc...
When I go to the media\library menu item in the dashboard, I don't see all the files that I have moved. I see only half of the files that I have moved.
What should I do to see all the files that have been uploaded in the dashboard?

If you already have the images inside the media library actual folder you could use the plugin "Media from FTP" it will easily scan your actual media library folder and "add" the images that are not there.
The plugin will "register" the images in the folder to the wordpress database.
Another solution will be to modify your XML file to point to a place in your actual domain (the destination) outside the media library.
Say you have your destination domain as: yournewsite.com
You will want to export the origin pictures to yournewsite.com
You edit the export XML file and modify all the references to youroldersite.com/wpcontent/uploads to yournewsite.com/uploads
You then move the actual images from youroldsite.com/wp-content/uploads/ into yournewsite.com/uploads
That way you don't "overwrite' the pictures when you do the import, you let wordpress read the images from your new domain and allow you to insert them into yournewsite.com/wp-content/uploads
For some reason, when wordpress tries to read the images from youroldsite it will fail and tell you media import error and you get an empty media library.
With the trick I told you, you will populate your library just fine.

Related

Does NextJS copy images for export?

I am creating a website that is meant to be a static website, but I have a photo gallery with descriptions on one page that I am using WordPress as the CMS. All the data is from WP is fetched using getStaticProps().
My question is, when you run next export, does Next export these images to the output folder? If not, the img link will not work, since it will link to my computer.
If that doesn't work, any thoughts as to how this can be solved without running a server?
No, Next.js does not export the images files to the output folder. If your wordpress is already deployed, the img link will work for next export, otherwise it will be linked to your localhost if your wordpress is not deployed.

Export original media files from wordpress

I'm trying to export the image media files from a WordPress blog but I'm not able to find any option or a plugin that can solve this issue.
I need to have all the media files, images and audio files, in a zip with the original name so I can rebuild the blog posts entirely in separate html pages.

How to Revert Back Previous Custom Media Storage Link on WordPress via Filezilla

Actually the previous developer use custom media storage for the wordpress
storage media by that we not able to add new media because it display error at the time of upload directory not created check its parent have the write access .. that type of error it shows. So to avoid that error we change the custom media storage link to default one: which is now.. wp-content/uploads
After that site is running fine but when I saw some images are showing thumbnail problem then after sometime site is down and it showing only error message.
Only way I have where I make it work again is by using Filezilla.
I had also make a backup of it. Which I restore after by using only the wp-config file. By that site is running again but As I said if I visit another of it pages which are basically full of products images then again site will down.
I tried so many things by adding code lines in wp-config file to add that custom link again which previous developer was use but all in vain.
I had update the link by login to the wordpress media settings. But now it not shows any area to add custom link anywhere.
define('UPLOADS',".'media');
I have also try that line of code by creating a folder in Wordpress with 'Media' and add all the media files into this but is also not work for me.
And Originally my media files path is /public-html/wp-content/uploads
I just want to resolve it by previously customized adding link option and also want to enable the permission to add new media without disturbing the already publish images and other media on the running wordpress site.
did the previous developer use /year/month/ structure and you simply copied everything from /media to /uploads?
i would say, edit directly the database. first, checkout the links in the field GUID
SELECT * FROM wp_posts where post_type='attachment'
the links are in the GUID field. Now take a database search and replace tool and replace the wrong paths on the whole db:
eg:
https://example.com/media with https://example.com/wp-content/uploads
and escaped
https://example.com/media with https://example.com/wp-content/uploads
and just to make sure, also replace the url-encoded versions (get it with this tool)
this should fix all permalinks as well as the links in the post-contents.

Transferring media with posts while moving wordpress blog to another server

I am trying to move a wordpress blog from one server to another server. I am able to move the posts and user accounts. I am able to move the media uploaded by the users but they are no longer linked to the posts. How can move the media with the posts without losing the linking
In order for the media attachments to be linked to your Posts, you need to migrate all of the wp_posts table also, not only the parts of it. As each attachment is actually linked by a parent_post field with other posts.
Also, you can use the WordPress Importer plugin to import the posts. By importing the posts, the attachments will be downloaded in the new server and linked with the posts. But if you have a lot of post and media files, that would take time.
Export tool
You can export your posts, pages, comments, custom fields, categories, and tags from one WordPress website to another website by creating an XML file.
Download and save this XML file to your computer .and by using import function in other WordPress websites you can import XML file.
To open Export tool go to Dashboard> Tools > Export.
Now click on an Export button it will open a new window.
what_to_export
There you can see three options
All content – By using this option you can export all content of website including posts, pages, comments, custom fields etc.
Posts or Pages– By next two options you can export Posts or Pages content. On selecting Posts or Page option, it will open a new window with different options like authors name, date range, and status. Hence by using these options, you can select your desired pages or posts that you want to export.
download XML FILE
After doing all settings click on Download Export File. An XML file will automatically start downloading to your computer.
Import tool
You can import posts, page or comments or other content from another WordPress.com or WordPress.org blog or site. To open import tool go to Dashboard > Tools > Import.
By default, WordPress does not provide import functionality. Hence to get this feature you have to install a Plugin.
On clicking on import .it will open a new window where you can choose a plugin according to your need from the list of plugins.
import_tool
WordPress importer- is used for Import posts, comments, custom fields, pages, and categories from a WordPress export file.
Now just click on WordPress out of all plugins. It will release a new window .where you click on install now button to install the WordPress importer.
install_importer
Now activate this plugins .after activation it will open a new tab from where you can choose your exported XML file (created by using the export tool) from your computer.
choose_XML_file
Now click on upload and import XML file. It will automatically add your exported content to your website and that’s it.
Hope this will help you
You need to export your posts from your old site, import them to the new site and then redirect the post to their new location.
You could start by packaging up your Files.
Well if you simply If you simply drag and drop files from one server to another using a GUI interface, chances are good that the GUI will omit hidden files such as the vital .htaccess file. Besides, transferring hundreds of files via FTP can take a long time because each file must often undergo some sort of authentication; in other words copying over a hundred 1 megabyte files takes a lot longer than copying over a single 100 megabyte file.
On a UNIX style system, you can create a compressed file using the tar command:
tar -czf /path/to/backups/modx_revo_site.tar.gz /path/to/modx_doc_root/
Once you arrive on the other end, it's good to put the zipped file into its own directory before you extract it. The idea here is that if it explodes, it's easier to clean up the mess if it's contained in its own directory.
On a UNIX style system, you can unpackage a .tar.gz file using the following commands from a command line:
gunzip modx_revo_site.tar.gz
tar xvf modx_revo_site.tar
Once you've extracted the files, you can move the whole directory into the correct place. Again, be careful about moving files in bulk: you might inadvertently forget to copy those hidden files. It's better to rename or move the containing directory instead.
Detailed explanation can be found under: https://docs.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server
Important is, that you use a permanent redirect not a temporary redirect. This will decrease the SEO Power over time. The Temporary Redirect redirect status response code indicates that the resource requested has been temporarily moved to the URL given by the Location headers.
Totally agree with the above said methods. Make sure to include all media and copy the authorizations as well. I had some issues a while ago when I tried to move my content on another server an totally forgot about the authorizations...

Folder permissions for custom Wordpress uploads folder

I have created a new Wordpress website on my server and done everything as I normally would (nothing fancy or custom, just upload theme, a couple of plugins etc.) except I wanted a custom file path to my media folder.
I have created the folder '/public_html/i', updated my .htaccess file, updated the Setting > Media section in Wordpress with the file path and all is working fine.
My issue is that I do not want the uploads folder to be visible by navigating to the URL (www.site.com/i/).
If I change the folder permissions to execute only for group / world (711) the images become unavailable / unviewable and although I can still upload they show as broken images.
If I set to execute and read (755) the images and uploads work fine but the folder can be viewed by typing in the URL.
What are the correct permissions I should be using for a custom uploads folder to make images on the site viewable but the containing folder itself not?
Note that this is a site that will regularly have new images uploaded to it, so I would also need to be able to upload without having to change the permissions each time, which is one solution I have found online.
Thanks in advance for any help.
Add the following to your .htaccess file with the WordPress .htaccess instructions:
Options -Indexes

Resources