WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I copy a developed web site from PC to server (9 posts)

  1. Begadoc
    Member
    Posted 2 years ago #

    The more I researech this question the more complicated seems the answer!
    I am just starting a conversion of a very large CSS/HTML site to WordPress. When I finish I will have a working and tested site on my PC comprising several hundred pages, mostly static ones. I don't want to do this conversion until I know how I can copy all the necessary files to my server when I finish and still have my correctly and fully functioning site. From what I read, it seems that the process of copying a working site on localhost to a domain on an on-line host is not that straightforward. I therefore would like to try it out on a few pages first and be sure of the trasfer system before I start.
    So could anyone point me to an idiot's guide to doing this? Thanks.

  2. Jacob Chappell
    Member
    Posted 2 years ago #

    As long as your web server has similiar settings to your localhost, it shouldn't be too much of a problem. I reckon these steps should do it.

    • Export your WordPress database in phpMyAdmin
    • Upload all of your WordPress files to your web server
    • Import your WordPress database into your web server
    • Change your database login information in wp-config.php to match your web server
    • Change your SITEURL and HOMEURL in wp-config.php to match your web server (example below)

    The last step is one that probably gets people. The SITEURL and HOMEURL need to be properly set in order for you to access your WordPress admin or any of your pages. If you haven't previously defined them in wp-config.php, you might be able to ignore this step and see if WordPress picks up on it (just try to login and see if it works). Otherwise, you can use the following code:

    define( 'WP_HOME', 'http://yoursite.com' );
    define( 'WP_SITEURL', 'http://yoursite.com' );

    I think that should get you started.

  3. Peter Wooster
    Member
    Posted 2 years ago #

    Don't forget to adjust any urls in the database. Most of these are easy, but any stored in arrays in wp_options will be preceded by a length that must be adjusted.

    I fix the urls by editing the database dump file, and avoid the length problem by using development site names that are the same length as the production site, e.g. if the production site is foobar.com, the dev site is testfoobar or foobar.net.

    /peter

  4. Begadoc
    Member
    Posted 2 years ago #

    Thanks both for your replies. I'll see if I can make sense of them and try and copy a small site over to the server and see if I can get it to work.
    Not being an expert in this field (I'm a retired medic) I am having to rely on tutorials and books to get to grips with this and I have to admit some of your explanations are in a foreign language! Hence my asking for an "idiot's guide".

    A couple of questions for now - I assume I should setup a mySQL database on the server first, copy the WordPress files to the server and then import the database.
    Basic question - in what folder(s) is the data kept?

    I won't label this topic as resolved as I suspect I'll be back.

  5. fonglh
    Member
    Posted 2 years ago #

    Basic question - in what folder(s) is the data kept?

    None. All the data is in the database.

    However, files you upload (PDFs, pictures etc) are in the wp-content/uploads folder.

  6. Begadoc
    Member
    Posted 2 years ago #

    Pardon my ignorance,but where is the mySQL database? As I understand this, WordPress has multiple files and folders which control how data stored in a database is displayed. But the data that is used for example, to produce a static page, or indeed the various posts people make, must be stored in file(s)/folder(s) which make up the database somewhere.

    I can see where the WordPress code is, but where are the files that make up the mySQL database?

  7. fonglh
    Member
    Posted 2 years ago #

    Depends on how MySQL is configured. In Ubuntu it should be /var/lib/mysql

    You don't have to be concerned about it at all, and your host probably won't give you direct access to the data files.

    You can always the export the database to a text based .sql file.

  8. Jacob Chappell
    Member
    Posted 2 years ago #

    You should have access to a database tool called phpMyAdmin. If you login to that, select whatever database you installed WordPress under, then click the "Export" tab, all you have to do is find the box at the bottom to save the export as a file.

    Later on when you're on your actual web server, you can do the same thing (except this time click the "Import" tab) and that's where you'll upload the file you exported previously.

    If you upload all the files in your wordpress directory (all the root level files and everything in wp-admin, wp-includes, and wp-content, etc.) and export the database, you'll literally have everything WordPress uses.

  9. Begadoc
    Member
    Posted 2 years ago #

    I am having problems with the Import part - I get the error message Import WordPress

    Sorry, there has been an error.
    The uploaded file could not be moved to /var/www/vhosts/stbees.org/httpdocs/wp-content/uploads.

    The uploads folder does exist (I had to create it manually) but permissions seem toinsist on being only the Everyone Execute ticked. If I tick the other boxes it seems to re-set itself to just the one.

    I assume this is a problem I need to get my hosting service to address.

Topic Closed

This topic has been closed to new replies.

About this Topic