WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Lost some complex formatting when transferring servers (50 posts)

  1. Marie0930
    Member
    Posted 1 year ago #

    We recently moved our company website from an externally hosted server to an on-site server through our in-house IT department. I backed up our wordpress website via FTP and Backup Buddy to be safe.

    We are wanting to recreate the site on our sandbox site so that we can make some visual changes. However, when I upload the site to our sandbox site there are some formatting differences. Everything is copied exactly via FTP so what could be causing these formatting issues?

    Thanks!

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Are the differences solely visual?

  3. Marie0930
    Member
    Posted 1 year ago #

    Andrew,

    The differences are solely visual. All functionality seems to work fine. The issue is that the widget areas seem to be completely mixed up. It looks like a puzzle that got all mixed up.

    Thanks!

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Do you know whether your website/ page with the problems conform to W3C's validator?
    http://validator.w3.org

  5. Marie0930
    Member
    Posted 1 year ago #

    It does not. I just input both sites. The one that is formatted correctly and the one which is not and they both come up with errors. Actually the one formatted correctly had 8 more errors than the one not showing correct formatting.

  6. Marie0930
    Member
    Posted 1 year ago #

    And I will say the only formatting issues are in the widget areas. The homepage is essentially entirely widgets. The widget areas that were created are all there on both sites. It is just the formatting of the widget areas that is somewhat off.

  7. Marie0930
    Member
    Posted 1 year ago #

    If this helps anyone in helping me out. I did a page source compare and the pages source code literally is the same with a few minor exceptions. First and obviously, the website URL and media URLs are labeled with the new site URL instead of the old one.

    However, there is another issue that I think would cause issues, but I am not sure how/where to fix it. I notice in the source that there are some div id="text 10" (or various numbers such as "text 24" ect ) that are not name the same on both pages.

    For example, on the correct page it may say div id="text 10" and the new page will say div id="text 5"

  8. Andrew
    Forum Moderator
    Posted 1 year ago #

    For example, on the correct page it may say div id="text 10" and the new page will say div id="text 5"

    Can you apply the correct id values to some <div> elements, to see whether this could be the issue?

  9. Marie0930
    Member
    Posted 1 year ago #

    The issue is finding these div elements. The site was created by a company and I was told we could just copy the FTP to the new site and all should be well. However, that was not the case.

    I have combed through the editor to the best of my ability and can not seem to find these elements. The are also using a plugin called "scripts and styles" which has a lot of that info in it. I did find a few of the div ids there but they match up. So I am not sure where to find them to change them.

  10. Marie0930
    Member
    Posted 1 year ago #

    Note I have also went through each and ever file in the editor (style.css, function.php, ect) and copy and pasted the code from the old site into the new site just to ensure they were identical and they are. Where else could the div ids be located if they are not in the editor or scripts and styles sheets? I am literally lost because everywhere I know to look they are not there.

  11. Marie0930
    Member
    Posted 1 year ago #

    And it looks like these are div elements from plugins. So could that be the issue? The plugin named it something else on this site and the styling is calling a wrong/changed id?? If that made sense? I have never had this problem before and I have literally worked on this for about a week combing through everything to no avail. Hence why I am here looking for a different perspective.

  12. Andrew
    Forum Moderator
    Posted 1 year ago #

    You can add these IDs to <div> elements temporarily and easily through a browser Inspector tool, such as Google Chrome's built in Inspect Element tool.
    https://developers.google.com/chrome-developer-tools/docs/elements

    Have you used this tool before?
    Can you link the problematic website?

  13. Marie0930
    Member
    Posted 1 year ago #

    I have not used that tool before. I will take a look and see if I can figure out how to use it. My assumption would be that I would just change the IDs in the tool and see if it clears up the problem. If it does, I would need to seek out where in my site to make the changes?

    Unfortunately I can not link to the site (as you would not see anything) since it is a private sandbox tool for our design purposes only. It is not a public link :-/

  14. Andrew
    Forum Moderator
    Posted 1 year ago #

    If it does, I would need to seek out where in my site to make the changes?

    We'll get to that problem/ solution if this is the issue.

  15. Marie0930
    Member
    Posted 1 year ago #

    Okay, then I will see if I can give the Chrome tool a go and see what happens. Thanks.

  16. ALVAW3
    Member
    Posted 1 year ago #

    here is what I would do.

    download a copy of your .sql database from php my admin now, and open it in a text editor and then do a search for "youroldsite.com" and replace all instances with "yournewname.com" and then import that into a newly created mysql database, then update your wp-config.php file to point to the new database and reload the site, this should clear out any references to the old url, and ensure when you do the replacement in your text editor you do not input WWW or http:// simply the domain name of the site and directory if applicable. lets see if that helps and then go from there

  17. ALVAW3
    Member
    Posted 1 year ago #

    if your FTP was moved exactly as you say it must be related to the domain or url change which must be done a certain way in WordPress and if not done correct can cause all kinds of "wonky" errors :)

  18. Marie0930
    Member
    Posted 1 year ago #

    That works!! So how would I go about finding these div IDs to change them?

  19. Andrew
    Forum Moderator
    Posted 1 year ago #

    Are you responding to Alvaw?

  20. Marie0930
    Member
    Posted 1 year ago #

    The "That Works!" was directed towards Andrew. Changing the div IDs fixed the formatting errors. Now it is finding those in the files to change.

    Alvaw- I have actually done what you stated to no avail.

  21. Marie0930
    Member
    Posted 1 year ago #

    So yes Andrew.....changing the div IDs in Chrome did the trick. It is perfect now. So the question I have now is how do I find and change these IDs on the site itself?

  22. Andrew
    Forum Moderator
    Posted 1 year ago #

    As you're struggling to find the <div> elements, you could add ID values using jQuery in your footer.php file.
    Are you familiar with jQuery? If not, you may need to http://PasteBin.com your HTML and CSS, and link us the PasteBin page.

  23. Marie0930
    Member
    Posted 1 year ago #

    I am not very familiar with JQuery; however, the site developer used it a lot.

  24. Marie0930
    Member
    Posted 1 year ago #

    I just looked at the PasteBin.com. How exactly does that work? Thanks so much for all your help.

  25. ALVAW3
    Member
    Posted 1 year ago #

    1. Create an FTP backup of the live WordPress site before any changes are made.
    2. Login to PHP my admin on the live WordPress website and select your database name on the left, then click on export above, and then click the save as file type in the lower left and then click go and save this to your desktop.
    3. Open the .SQL file from step #2 in a text editor and then search for "youroldsite.com" and replace all instances with "SANDBOXsite.com" and then save this .sql file again on your machine. and be sure not to include WWW or http:// in the text replacement
    4. Create a new MySQL database on the SANDBOX server, login to PHPmyAdmin and click the import tab above and import your .sql file with the new URL from step #3
    5. Update the wp-config.php file from the FTP backup in step #1 with the new database name, password, username, and database host.
    6. Upload the FTP files to the SANDBOX and then visit the URL and all should be OK and you can smile, however you may need to reset permalinks.

    The reason im saying all this is because I move hundreds and hundreds of these and although plugins can cuase some seriously weird issues like you have here
    in my experience its the moving and changing of names that causes the issues and if done correctly WordPress should function as on the live site. Doing all those
    other changes is a risk and does not sound right to me. So take it or leave it, but I would give it a shot. Also this does not involve using anything with Backup Buddy so disable that before starting this process on the live site.

  26. ALVAW3
    Member
    Posted 1 year ago #

    sorry for all that! didnt refresh but you can do a search and replace on your php files in a text editor to fix that probably if that is the only issue now.

  27. Andrew
    Forum Moderator
    Posted 1 year ago #

    If the above technique doesn't work,
    Within your footer.php file, just before the </body> element, could you try adding;

    <script type="text/javascript">
    jQuery(document).ready(function($) {
    
     // Within this bit, $('') you need to add the <div> elements that you want the id attached to.
     // You can use multiple selectors and here's a tutorial how http://api.jquery.com/multiple-selector/
    
     $('').attr('id', '');
    
     // Within this bit, ('id', '') you need to add within the second apostrophes the actual ID value,
     // you can only add one value. E.g ('id', 'text 10')
    }
    </script>

    Here's a resource on jQuery attr function
    http://api.jquery.com/attr/

  28. Marie0930
    Member
    Posted 1 year ago #

    alvaw,

    Yes I did everything as outlined in your steps. I did that as well as secured a copy via backupbuddy. It ended up wonky. Literally all links have been changed to the new site...everyone. The literal only difference in the two sites (aside from links now reading...sandbox instead of old site) is the div IDs. Literally the ONLY thing different. It makes now sense and I have moved sites before with absolutely no issue.

    It seems that for whatever, the plugins utilized are causing some major issues when transferred. When I changed the div ID tags via the Chrome tool it looked perfect, so I am willing to give it a shot as what you outlined above is exactly what I did originally.

  29. Marie0930
    Member
    Posted 1 year ago #

    And I have searched all the PHP files and can not find them. This is literally the wackiest thing I have seen.

    I am going to give Andrew's method a shot and will update.

  30. ALVAW3
    Member
    Posted 1 year ago #

    try disabling the plugin and then moving the site and then reenabling, and some of those plugins have an export settings feature, ensure that is not there, but again a search and replace inside of your page.php or singlepage.php or post.php or any php file could change these quickly perhaps and in bulk.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.