Jump to content
Killersites Forums

Recommended Posts

Hi everyone!


I'm a web newbie and I've only made new websites. i've never taken over an existing website before. I work pretty much only in wordpress, but I've dabbled with Joomla, and I can make basic website coding through dreamweaver. As you can see, this is all pretty much front end stuff.


A friend of mine recently fired her web developer (billing issues), and asked if I can redesign her site. I warned her this is out of my league, but agreed to give it a shot. Because the site is existing. I can't just edit things to the live site like I've done with others. I'm going to recommend a new wordpress theme, but wanted to try a few themes out before I made my final recommendation. So I want to test these things out before they go live. 


So I understand the idea, that I need to make a local test server, that essentially is a mirror of my live site. And on this test server I can feel free to play around and change things. So I downloaded MAMP, assuming I'd use that to set up my server. When I do so, it tells me that there is an error establishing a database connection. I checked to make sure that everything looked right in my wp-config.php file and it does. So now I'm confused.


So this brings up a few questions:

1. What am I doing wrong with respect to MAMP

2. Is there a different way besides MAMP?

3. I have another site that I've used previously as my demo site. Is there a way to copy all of my files from the new live site (wordpress and all) and import them to my existing site? my existing site is just live all of the time, but  who cares, no one is looking at it. Then once I make all of the changes i want, can't I just then copy all of these new files, and then upload them to the new site?



Thanks! You all are wonderful!



Link to post
Share on other sites

Hi Ben,


I have copied the database over. I fortunately have all of the back-ups too. Horray! 


Yes I'm using the correct username/pw, but I am confused what you mean about what i need to change in wordpress. I think this may be the key to my issue!!

Link to post
Share on other sites

Can you post your database connection details section of your wp_config.php file? (if this is only running on your local computer, there should be no problem regarding security or privacy -- just don't post the database details of the live website). Are you sure the name of the database is accurate? And the server value listed is "localhost"? And of course that the server and MySQL is running?


If you are getting a database error, it won't be a path issue. But that will likely be an issue after you fix your database connection. Wordpress stores the path to the website in two spots in the options table in the database, that will need to be updated. In addition, any links to resources (images, downloads, etc.) will often refer back to the old site. To fix this, I've used both https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ (free) or https://deliciousbrains.com/wp-migrate-db-pro/ (paid) in the past.

Link to post
Share on other sites

Hi Ben,


I think this may be the problem! My wp_config.php file has the information for the live website. How do I change this to my local computer? What would a sample look like? 


Currently it has the database username and password for the real database for the live site. 


These areas have the information for the real site 



// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
/** Database Charset to use in creating database tables. */
/** The Database Collate type. Don't change this if in doubt. */
 * WordPress Database Table prefix.
 * You can have multiple installations in one database if you give each a unique
 * prefix. Only numbers, letters, and underscores please!
Link to post
Share on other sites

Argh I am so close. Its frustrating but I am learning a lot.


The files that I inherited are separated into filesystem backups and database backups. I assume I need to put a filesystem backup (that has all of the wp files) and the corresponding database backup (that are all .sql formats) into one folder, correct? 


When you say if I am running map the username is root and the password is root, is that when I open the database, or is that what I type into my wp_config.php file? I attached a screenshot of what it looks like when I open a database backup and when I open the filesystem backup




I feel like such a newbie!

Link to post
Share on other sites

I believe that's the same username/password for both.


So on your localhost, you just have an export .sql file? You haven't used PHPMyAdmin or MySQL Workbench to create the local database and import the information in?


This http://www.smashingmagazine.com/2013/04/08/moving-wordpress-website/, or similar articles, might be useful to reference?

Link to post
Share on other sites
  • 2 weeks later...

New issue.  Thank you Ben for sending me that link. Now:

When i type localhost, it goes directly to where i want to go, but then when I press any page it doesn't go to localhost/about or, it goes to the actual URL/about. argh! What do I do?

Link to post
Share on other sites

I'm not sure where you are in the process, but see my earlier advice:


Wordpress stores the path to the website in two spots in the options table in the database, that will need to be updated. In addition, any links to resources (images, downloads, etc.) will often refer back to the old site. To fix this, I've used both https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ (free) or https://deliciousbrains.com/wp-migrate-db-pro/ (paid) in the past.


If your site looks "super wonky", it just means you have more work to do -- likely there are other paths that also need changing.

Link to post
Share on other sites

Oh! It may be the second spot in the database. I can only find one place where it lists the website path. I must find the second path. That may do it, and wonky is when it looks like the picture added. one is from when I didn't change the site url and the second photo is from where I did. Also once I changed the site URL, my top page navigation disappeared. 


Thanks for being so darn helpful, Ben! :)



Link to post
Share on other sites

I'd really just suggest you use https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ to find instances of the old domain and replace it with the updated localhost version. Yes, the URL is set in two post in the wp options table. But in many cases, there are other paths -- usually links to documents or images -- that will still link to the old URL, and won't change if you just change the options table.

Link to post
Share on other sites

I too recommend the tool from interconnect. It's simply just one php file that you run, set up your db info and define a search query to find and replace. I currently use the 2.1.0 stable version.  I have not tried the 3.0 beta version and probably won't until it releases the stable version.  2.1.0 works flawlessly for me.

Link to post
Share on other sites
  • 3 weeks later...

If you're running MAMP, the username is "root", the password is "root", and the hostname is "localhost". The name of the database will depend on whatever you named the local database when you copied it over.

Edited by Andrea
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...