WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Duplicator
[resolved] [Plugin: Duplicator] Could not access attached media files after site cloning to other PC (11 posts)

  1. Krauser
    Member
    Posted 1 year ago #

    Hi lifeinthegrid,

    First thing I do is create a package via localhost. The wordpress address and site address are configured http://localhost.

    I have successfully migrated the site to another PC. But the problem is, I could not view the attached files when I click on the link. I checked the url of the media files and it starts with localhost. But when I click on the attachment, it displays the IP address of the previous PC.

    The error is this:
    Forbidden
    You don't have permission to access/wp-contnt/uploads/{filename}

    On the browser, I changed the IP into localhost and it can view the attachment. But this is bad because it should directly view or download the attachment without changing the url.

    I assume this might need tweaking on phpMyadmin. I use WAMP.
    Any help would be very much appreciated.

    Thanks

    http://wordpress.org/extend/plugins/duplicator/

  2. lifeinthegrid
    Member
    Plugin Author

    Posted 1 year ago #

    Hey Krauser,

    Sounds like the url did not get updated correctly in the database. The replace logic only replaces the Package URL (old url) with the install url (new url), so if those values are not "exact" then they won't get replaced. What are the paths of the attachment files? Sometimes they don't match the old url exactly, which means they won't get replaced.

  3. Krauser
    Member
    Posted 1 year ago #

    The paths are http://localhost/wp-content/uploads/{filename}. I checked the two PC's and they have the same url. I'll try putting WAMP offline and do a localhost backup and then clone it to another PC. It might get the data of the old PC because I backed it up while WAMP was online. But the general settings are still set to localhost.

  4. lifeinthegrid
    Member
    Plugin Author

    Posted 1 year ago #

    So if you entered in the following on the installer screen:

    Package URL (old url): http://localhost
    Install URL (new url): http://localhost

    Then no changes are going to be made in the database. All data that was originally stored with whatever pc1s ip was is still going to be there... How did you enter in the values above on the installer screen?

  5. Krauser
    Member
    Posted 1 year ago #

    Yes. Those are the values.
    I also tried the default which is http://localhost/. Even on PC1, I can't access the attached files because it wants me to change the home page url and site url to its IP.

  6. Krauser
    Member
    Posted 1 year ago #

    I think I get it now. Even though I successfully cloned the site. The links on the post does not change dynamically. When I looked at the links, it retains the IP address of PC1. It does not change dynamically on what is the url of the media file.

  7. lifeinthegrid
    Member
    Plugin Author

    Posted 1 year ago #

    Hey Krauser,

    If the Package URL and the Install URL are the same when you install onto PC2 then zero changes will take place PC2. Which means it's values will be identical to PC1. It sounds like you may have a hosts file issue or your webserver on the PCs are not setup to listen on localhost...

  8. Krauser
    Member
    Posted 1 year ago #

    My hosts file is the same. I read some articles about mod_rewrite and htaccess which might have to do with the urls of file attachments. I'll post it here if I find a solution. There might be someone who has encountered the same issue.

  9. lifeinthegrid
    Member
    Plugin Author

    Posted 1 year ago #

    You might also check the 'siteurl' setting in the wp_options table and validate that it maps to the correct location you want, that concept is explained here.

  10. Krauser
    Member
    Posted 1 year ago #

    Hi lifeinthegrid,

    I finally found a solution. When you move your site, the media attachments on post does not change dynamically. So, I used velvet blues update url plug-in to do the job. Its basically a find replace tool which searches urls.

    Thanks

  11. lifeinthegrid
    Member
    Plugin Author

    Posted 1 year ago #

    Hey Krauser,

    Thanks for the update I'll add it to the todo list...

    Thanks

Topic Closed

This topic has been closed to new replies.