Moving local wordpress to live server

15 replies
  • WEB DESIGN
  • |
Hello fellow warriors.
I will be uploading my wordpress site today live. I created the website offline using MAMP and I was wondering how exactly I should go on about uploading the site to server.

From what I understand I copy the content to FTP and import database using PHPmyadmin.

I'm just not sure that I know all the steps. For example I have images on my site that point to URL http://localhost:8888/wp-content/images... for example. Are those links going to be broken?

Is there anything I should avoid or be careful about? The site will be located in the root directory on my own domain.

Thanks.
#live #local #moving #server #wordpress
  • Profile picture of the author xtrapunch
    It is a fairly easy process. Transfer all your files to the server. Transfer the SQL date as well. Done. Transferring site from one server to another is the same process for both local and live servers. You can find details here: Transfer Website to New Host with Zero Downtime
    Signature
    >> Web Design, Wordpress & SEO - XtraPunch.com <<
    Web Design & SEO Agency | Serving World Wide from New Delhi, India

    {{ DiscussionBoard.errors[5727597].message }}
    • Profile picture of the author Istvan Horvath
      Originally Posted by xtrapunch View Post

      It is a fairly easy process. Transfer all your files to the server. Transfer the SQL date as well. Done. Transferring site from one server to another is the same process for both local and live servers. You can find details here: Transfer Website to New Host with Zero Downtime
      Actually, no - your article does NOT answer the OP question.

      What you wrote is valid ONLY when changing hosts but using the same domain.

      However, localhost and example.com are two different domains and nothing that you wrote (or only a part of it) refers to the OP's situation.
      Signature

      {{ DiscussionBoard.errors[5728103].message }}
      • Profile picture of the author yitbarek
        Originally Posted by Istvan Horvath View Post

        Actually, no - your article does NOT answer the OP question.

        What you wrote is valid ONLY when changing hosts but using the same domain.

        However, localhost and example.com are two different domains and nothing that you wrote (or only a part of it) refers to the OP's situation.
        I am also uploading my ecommerce site from local host to web server, can you give me step by step instruction? Adding what misses in the quoted post.

        Thanks.
        {{ DiscussionBoard.errors[5859501].message }}
  • Profile picture of the author Istvan Horvath
    To the OP:

    Your thinking is correct: all those links will be broken.

    Here is what you need to do:
    - after importing the .sql file into the new database, go to the wp_otions table and find
    "site_url" and "home" rows > instead of localhost, edit there the real domain (no trailing slash)
    - edit the wp-config file and put in the correct information for the DB user, name, pw

    After these two steps you can access your dashboard
    - install the Search and Replace plugin
    - replace "http://localhost/" with the "http://example.com/" in all the tables where it's necessary
    - if you uploaded the images (in the right upload folder, usually, wp-content/uploads/) then they will show up on the new location
    Signature

    {{ DiscussionBoard.errors[5728106].message }}
    • Profile picture of the author shermancox
      Originally Posted by Istvan Horvath View Post

      To the OP:
      - replace "http://localhost/" with the "http://example.com/" in all the tables where it's necessary
      Is there any reason why you wouldn't use relative paths to the images so that you won't have to do this step in the future? I mean if you are going to regularly deploy your local box to a server...
      Signature

      {{ DiscussionBoard.errors[5728484].message }}
      • Profile picture of the author Istvan Horvath
        Originally Posted by shermancox View Post

        Is there any reason why you wouldn't use relative paths to the images so that you won't have to do this step in the future? I mean if you are going to regularly deploy your local box to a server...
        When you are using WP's media uploader (i.e. upload an image while writing a post/Page) WP automatically creates absolute path for that image and it stores in the database table "wp_posts" as post_type "attachment" like this:
        Code:
        http://localhost/32/wordpress/wp-content/uploads/2011/07/P1000513.jpg
        And whenever you click on that insert into post thing - it takes the whole path/URL into the <src img code...

        Unless you rewrite some core file in WP - I don't see how would you avoid having the absolute path there
        Signature

        {{ DiscussionBoard.errors[5728637].message }}
    • Profile picture of the author osekdomains
      Isthvan, thank you for your information. I am following your steps but I am having problems with importing my database. It gives me this error:

      #1044 - Access denied for user 'xxxx'@'localhost' to database 'information_schema'

      I am not an expert on databases. However when I created new database and new user, I made sure the user had all the priviliges. Where might the problem lie?
      Signature

      Film Screenshot Quiz - win cash and prizes
      http://www.screenshotquiz.com

      SuperBMX - czech website for freestyle BMX beginners
      http://www.superbmx.cz

      {{ DiscussionBoard.errors[5730194].message }}
  • Profile picture of the author Cataclysm1987
    Originally Posted by osekdomains View Post

    I'm just not sure that I know all the steps. For example I have images on my site that point to URL http://localhost:8888/wp-content/images... for example. Are those links going to be broken?
    This is the biggest thing to be concerned about is changing your links.

    Most everything else is straightforward.
    Signature

    No signature here today!

    {{ DiscussionBoard.errors[5728198].message }}
  • Profile picture of the author osekdomains
    In more detail the error says this:

    CREATE DATABASE `information_schema` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

    I use czech language just for interface, so I don't know if I should switch things up or something. Please help me somebody or point me to someone, I need to get this site up ASAP.
    Signature

    Film Screenshot Quiz - win cash and prizes
    http://www.screenshotquiz.com

    SuperBMX - czech website for freestyle BMX beginners
    http://www.superbmx.cz

    {{ DiscussionBoard.errors[5730258].message }}
    • Profile picture of the author shermancox
      Hello,

      Is your script trying to create a database that already exists? In the past I have exported my database and then did an import into a database that already exists and get an error.

      If your database already exists, (but it is just empty), you might try to comment out that line that says "create database"...

      But that is only if the database does already exists....


      Originally Posted by osekdomains View Post

      In more detail the error says this:

      CREATE DATABASE `information_schema` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

      I use czech language just for interface, so I don't know if I should switch things up or something. Please help me somebody or point me to someone, I need to get this site up ASAP.
      Signature

      {{ DiscussionBoard.errors[5730418].message }}
    • Profile picture of the author osekdomains
      OK i figured out the problem. From MAMP interface (PHPmyadmin tab) I tried to export all the "databases", including "information_schema" (from what I understand it's some kind of system component of MAMP, but I'm no expert).

      The main problem was just simple lack of concentration. Instead of clicking on the INDIVIDUAL database, I clicked "export" on the homescreen with all databases selected, including those "system" ones.

      So when I tried to import it onto PHPmyadmin on my server it failed because it tried to overwrite the server's own databases.

      So it's simple, I just selected the individual database and imported it into new one. I can't believe I overlooked it but at least I learned something.

      Sorry for those weird terms as I don't understand databases at all.
      Signature

      Film Screenshot Quiz - win cash and prizes
      http://www.screenshotquiz.com

      SuperBMX - czech website for freestyle BMX beginners
      http://www.superbmx.cz

      {{ DiscussionBoard.errors[5730706].message }}
  • Profile picture of the author osekdomains
    oh my god I just found out what I was doing wrong. well i will write it here anyway in case someone stumbles upon this thread.
    I am using MAMP and when I logged in into the PHPmyadmin interface to export my database i did the wrong thing. instead of selecting one individual database, i just clicked "export" on the home screen which caused to export information_schema and others as well.
    i'm not an expert on this at all but i assume that these "other databases" are internal to MAMP and for example "information_schema" was already present on my server.
    so when i tried to import SQL file to new database, it probably tried to overwrite everything. after going through web tutorial once more i noticed that i didn't select the wordpress database.

    after i figured that out it was no problem. thanks Isthvan, you're very helpful and I'm sorry I flooded this thread because of my impatience and lack of concentration. it's just this website is important to me.
    Signature

    Film Screenshot Quiz - win cash and prizes
    http://www.screenshotquiz.com

    SuperBMX - czech website for freestyle BMX beginners
    http://www.superbmx.cz

    {{ DiscussionBoard.errors[5730600].message }}
  • Profile picture of the author Istvan Horvath
    Something wrong with the WF?
    I replied twice and they all disappeared..
    Signature

    {{ DiscussionBoard.errors[5731331].message }}
  • Profile picture of the author Istvan Horvath
    There is something wrong with the WF database - replied at least 3 times and it never got posted.

    The character set and collation are OK for any language - as it is. Leave it.

    It sounds as you exported too much...

    Go back to your local phpMyadmin and on the main page where you see on the left the different database names - click the one where your WP install is.

    Now on the right/middle you should see the WP tables, all with their prefix.

    While there > click the EXPORT now!

    Save the file and try the Import again.
    Signature

    {{ DiscussionBoard.errors[5731427].message }}
    • Profile picture of the author osekdomains
      Hello Isthvan,
      I received your personal message, I can't reply as I don't have my post count high.
      I went all over everything again and I realized I made stupid mistake. But even after I figured out I had a lot of problems anyway. I will list them here in case someone stumbles upon this thread.

      1. First mistake was that when exporting from MAMP I selected all the databases from PHPmyadmin (included "information_schema" and others). The stupid problem I made I just forgot to select my database from dropdown menu so when importing to live database, it was trying to override the system databases on server which caused errors (sorry I'm not technical much so it's not probably that accurate).

      2. The database imported allright but after uploading wordpress installation to server (and I made sure I replaced localhost URL with my real URL) not everything was in place. For example header image was missing, background pattern too, some plugins didn't contain data and few more. I really didn't know how to fix this so i just copied a pasted the code/text from MAMP installation and reuploaded some plugins. Shame, don't know where the probem lies though.

      3. As I found out about problem number two, I also found out about problem number three. All the hyperlinks on site were not working! Actually only the homepage worked, everything else was broken. Fortunately the support at Justhost.com on live chat is quite helpful and their advice worked brilliantly. I just had to re-save my permalinks and that fixed it.

      4. Another issue, my RSS channel doesn't work. I'll try to work it out (I have buddypress plugin installed and only RSS that works is sitewide activity feed).

      5. I cannot send out activation emails for users. This is probably due to some limits from my hosting company, or at least that's what I suspect. Meanwhile I had to install plugin that makes activation emails for new users redundant. I'm afraid that spammers will come, but I don't know what else to do.

      So you see, moving local installation live isn't as easy as it sounds, at least not for everybody. But thank god the site works as it works.
      Signature

      Film Screenshot Quiz - win cash and prizes
      http://www.screenshotquiz.com

      SuperBMX - czech website for freestyle BMX beginners
      http://www.superbmx.cz

      {{ DiscussionBoard.errors[5737608].message }}

Trending Topics