SitePoint Sponsor

User Tag List

Results 1 to 21 of 21
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Transferring files from localhost to a web host (wordpress website)

    I've developed my wordpress site locally and added all the posts and images locally. Its in C: ->wamp: ->www:->websitefolder

    Now if i'm gonna put the files on the root folder in the server, do i just copy the contents inside the websitefolder and paste in webservers root folder or do i have to do anything else?

    I'm asking because there is a database created locally with phpMyadmin and i was wondering if migrating the whole thing was going to be easy?

    Thanks,
    Jaysone

  2. #2
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just transfer the files with a FTP client, keeping the structure the same, and then download a backup of your wordpress database through phpMyAdmin and upload on your web phpMyAdmin. Change your config files MySQL username/pass/server settings to reflect the changes, and you shoul be good to go.
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, If i'm having any troubles i'll be back.

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Possibility View Post
    Just transfer the files with a FTP client, keeping the structure the same, and then download a backup of your wordpress database through phpMyAdmin and upload on your web phpMyAdmin. Change your config files MySQL username/pass/server settings to reflect the changes, and you shoul be good to go.

    What do you mean by " Change your config files MySQL username/pass/server settings to reflect the changes"?

    Please help me out as this is my first time doing this. How do i upload this?

    What i've done

    1) I've downloaded and saved my database on my desktop (the file is zipped and its called energyworkforce.sql.zip)
    2) I've extracted Wordpress 2.7 and then i've edited the wpconfig.php file so that it matches the exactly the way it is when i developed locally. Everything in wpconfig.php is the same as how i edited the wpconfig.php for local development.
    3) i've uploaded the contents of the Wordpress 2.7 folder that i extracted and (which i edited the wpconfig.php file to my webhosts root directory.

    5)How do in upload the database under which category?

    Thanking you in advance
    Kenneth Jaysone Francis

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Upload the database to where the wpconfig file expects to find it.

    You will need to change the two entries in the database that identify where the blog is to be found and what address to display.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Upload the database to where the wpconfig file expects to find it.

    You will need to change the two entries in the database that identify where the blog is to be found and what address to display.

    Thank you so much for your help. My problem is i dont know where my wpconfig file expects to find my database. I'm totally new to this..please help me.

    When i typed http://energyworkforce.net/wp-admin/install.php

    This is what i got

    Can’t select database

    We were able to connect to the database server (which means your username and password is okay) but not able to select the energyworkforce database.

    * Are you sure it exists?
    * Does the user kenneth have permission to use the energyworkforce database?
    * On some systems the name of your database is prefixed with your username, so it would be like username_energyworkforce. Could that be the problem?

    If you don't know how to setup a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

    Please help.

    Thanking you in advance


    Sincerely,
    Kenneth Jaysone Francis

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Are you sure you have the database set up on the server under that name?
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Are you sure you have the database set up on the server under that name?
    On my phpMyAdmin, it shows the name of the database as energyworkforce.

    I dont know where that database is stored. My local root folder is in a folder called www thats located in the wamp folder thats in Crive.

    When i test my wordpress site locally, it works fine.

    I copied the contents of the folder thats in my C: Drive (the folder called energyworkforce) and i put the contents of that folder into the webhosts root folder.

    I really dont know what to do...

    Thanking you in advance,
    Kenneth Jaysone Francis

  9. #9
    WordPress Freelancer banago's Avatar
    Join Date
    Dec 2006
    Location
    Vlorë, Albania
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kennethjaysone View Post
    I copied the contents of the folder thats in my C: Drive (the folder called energyworkforce) and i put the contents of that folder into the webhosts root folder.
    Did you export/import the MySQL database too?
    WPlancer.Com - PHP & WordPress Developer
    ProverbHunter - English Proverbs Explained

  10. #10
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by banago View Post
    Did you export/import the MySQL database too?
    I exported the database using the export tab on to and i saved it as a zipped file. Now the thing is i dont know where to upload (in the server) this file that i extracted (database file)?

  11. #11
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by banago View Post
    Did you export/import the MySQL database too?
    I managed to create a database with the webhosts tools and i edited the wp-config.php file to match the required details. After creating the database i managed to import the database from my desktop and i managed to put in all the files.

    Please visit www.energyworkforce.net, there is a problem. The homepage is appearing with no style sheet and when i hover over each link, i see at the browser that it points to localhost. For example the main header of the page, when i hover over it, it shows http://localhost/energyworkforce

    Why is this, is there anything i need to edit?

    Thanks a million!

    Kenneth

  12. #12
    WordPress Freelancer banago's Avatar
    Join Date
    Dec 2006
    Location
    Vlorë, Albania
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kennethjaysone View Post
    Please visit www.energyworkforce.net, there is a problem. The homepage is appearing with no style sheet and when i hover over each link, i see at the browser that it points to localhost. For example the main header of the page, when i hover over it, it shows http://localhost/energyworkforce
    I am happy you could import the database successfully. Here is the solution for the CSS problem:

    1. Go to your header.php and find:
    2. Replace the above link with:
    <?php bloginfo('template_url')?>/style.css
    3. Let me know how it works - theoretically it should work fine.
    WPlancer.Com - PHP & WordPress Developer
    ProverbHunter - English Proverbs Explained

  13. #13
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by banago View Post
    I am happy you could import the database successfully. Here is the solution for the CSS problem:

    1. Go to your header.php and find:


    2. Replace the above link with:


    3. Let me know how it works - theoretically it should work fine.
    Thank you banago, i managed to upload the site www.energyworkforce.net.

    There is one problem now, i cannot login to www.energyworkforce.net/wp-admin

    The page appears but when i login using the password that i used when i was developing it locally, it just gives me a blank white page.

    How do i rectify this?

  14. #14
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you should also update the details of your config...

  15. #15
    WordPress Freelancer banago's Avatar
    Join Date
    Dec 2006
    Location
    Vlorë, Albania
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kennethjaysone View Post
    The page appears but when i login using the password that i used when i was developing it locally, it just gives me a blank white page.

    How do i rectify this?
    Well, I think there is something missing in the wp-admin folder rather than wrong password. Can you delete/reupload the wp-admin folder?
    WPlancer.Com - PHP & WordPress Developer
    ProverbHunter - English Proverbs Explained

  16. #16
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by banago View Post
    Well, I think there is something missing in the wp-admin folder rather than wrong password. Can you delete/reupload the wp-admin folder?
    It absolutely worked!! thank you and everybody in this thread for helping me so much. Really grateful.

    Banago, i have 1 question, when i developed the site locally, i inserted all the pics in the various posts and pages. After uploading everything, why isn't the pictures appearing on the site?

    Please have a look at it www.energyworkforce.net. I looked into the wp-content folder (in the webhost's server) and i found a folder called uploads. Inside the uploads folder there was folder named 2008 and then another folder called 12.

    I presume that it is because the images were inserted in December. I thought of using the same method of deleting and re-uploading the files but this time it didn't work. Any thoughts in this?

    Thanks a zillion

  17. #17
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I checked the root directory on the server to see if there were any files i missed out particularly the wp-content folder (in the webhost's server) and i found a folder called uploads. Inside the uploads folder there was folder named 2008 and then another folder called 12.

    All the images are in there. So i don't know what is really wrong?

    I thought maybe i'd have to use Wordpress's dashboard (live) and then insert the images again. For testing purposes i edited a page and tried to insert an image and this is the error i got on the Wordpress Dashboard:

    Unable to create directory C:\wamp\www\energyworkforce/wp-content/uploads/2008/12. Is its parent directory writable by the server?

    How can i rectify this?

    Thank you so much,
    Jaysone

  18. #18
    WordPress Freelancer banago's Avatar
    Join Date
    Dec 2006
    Location
    Vlorë, Albania
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kennethjaysone View Post
    I checked the root directory on the server to see if there were any files i missed out particularly the wp-content folder (in the webhost's server) and i found a folder called uploads. Inside the uploads folder there was folder named 2008 and then another folder called 12.

    All the images are in there. So i don't know what is really wrong?
    The problem is with your database. The database has the links stored with your old link i.e.: localhost/etc/etc

    My advice is this:
    1. Get to your PHPMyAdmin
    2. Click SQL (which will open SQL editor where you can run queries) and
    3. Run this query:
    Code:
    update `wp_posts` set `post_content` = replace(`post_content`, ‘http://localhost/energyworkforce’, ‘http://www.energyworkforce.net’);

    This would theoretically fix all your links. But, to be sure, export your database before running the query.

    I thought maybe i'd have to use Wordpress's dashboard (live) and then insert the images again. For testing purposes i edited a page and tried to insert an image and this is the error i got on the Wordpress Dashboard:

    Unable to create directory C:\wamp\www\energyworkforce/wp-content/uploads/2008/12. Is its parent directory writable by the server?
    You need to change the access permission of your wp-content folder to fix this. All you need to do is chmod wp-content folder to 755. This would work and be save in most hosts. But there are some hosts that require that it is set to 777 so work.

    This is all I think - I would love to know if I was helpful
    WPlancer.Com - PHP & WordPress Developer
    ProverbHunter - English Proverbs Explained

  19. #19
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by banago View Post
    The problem is with your database. The database has the links stored with your old link i.e.: localhost/etc/etc

    My advice is this:
    1. Get to your PHPMyAdmin
    2. Click SQL (which will open SQL editor where you can run queries) and
    3. Run this query:
    Code:
    update `wp_posts` set `post_content` = replace(`post_content`, ‘http://localhost/energyworkforce’, ‘http://www.energyworkforce.net’);
    I tried doing what you told me and i got this error on phpMyAdmin

    Error

    There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

    ERROR: Unknown Punctuation String @ 69
    STR: ://
    SQL: update `wp_posts` set `post_content` = replace(`post_content`, ‘http://localhost/energyworkforce’, ‘http://www.energyworkforce.net’);


    SQL query:

    update `wp_posts` set `post_content` = replace(`post_content`, ‘http://localhost/energyworkforce’, ‘http://www.energyworkforce.net’);

    MySQL said: Documentation
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '://localhost/energyworkforce’, ‘http://www.energyworkforce.net’)' at line 1


    Quote Originally Posted by banago View Post
    You need to change the access permission of your wp-content folder to fix this. All you need to do is chmod wp-content folder to 755. This would work and be save in most hosts. But there are some hosts that require that it is set to 777 so work.

    This is all I think - I would love to know if I was helpful
    Eventhough there was an error on phpMyAdmin, i still went and changed access permission for the wp-content folder to 755 and also tried 777. It didn't work.

    I wanted to share with you this article:

    http://www.wains.be/index.php/2007/0...#comment-68438

    After reading it, i e-mailed my webhost but they've still not replied to me answering on whether i could change the safe_mode_gid=On in the php.ini file?

    Thank you Banago for helping me so much. I'll definitely let you know if things work out. Please do let me know if you have any idea on how i can solve this.

    Cheers,
    Jaysone

  20. #20
    SitePoint Zealot
    Join Date
    Mar 2007
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by banago View Post
    I would love to know if I was helpful
    If it were not for people like you, i'd have smashed my head with a sledge hammer!

    To get the whole story, please go to this link: http://www.sitepoint.com/forums/showthread.php?t=590023

    Managed to solve my problems. This is what i did:

    I went to the wp-content folder in the server and deleted the folder call uploads which was inside wp-content.

    Then i manually created a path and named it uploads. I had to manually change the cmod to that directory to 777.

    Then i created a folder called 2008 inside the folder called uploads, did the same thing (cmod = 777).

    after that i manually created 12 folders inside the uploads folder naming them 01, 02, 03, 04, 05, 06 all the way to 12.(for the 12months in a year)

    And for these 12 folders i repeated (changed the cmod to that directory to 777)

    After that when i tried to upload the image, it worked.

    Just wanted to thank you again.

    Cheers,
    Kenneth Jaysone Francis

  21. #21
    WordPress Freelancer banago's Avatar
    Join Date
    Dec 2006
    Location
    Vlorë, Albania
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it were not for people like you, i'd have smashed my head with a sledge hammer!
    I am very happy to hear that. Good luck with your blogging
    WPlancer.Com - PHP & WordPress Developer
    ProverbHunter - English Proverbs Explained


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •