What i want to do:
Develop a Wordpress-based website with a local Wordpress installation (and xampp).
Migrate this developed website on my webserver.
What's the problem:
After putting the website on the webserver each link in the navigation references to "127.0.0.1/wordpress/...".
I'm not even able to login to the Wordpress Backend on the webserver, because the "login.php" (or something) is also referenced on the localhost"
My Question:
Do any of you know how I can change this permalinks to the URL of the webserver the website is actually deployed on?
best regards
matt
edit:
Another thing that i noticed is, that although I changed the URL in the wp_posts table manually, this database entries are changed by wordpress, so next time, after opening the website, the URLs in the database contains the 127.0.0.1 part
When migrating the database from your local machine to a remote server, you should export your mysql database that is on your local machine to a file. Then perform a search and replace changing "127.0.0.1/wordpress/..." to "www.yourdomain.com/path/to/wordpress" and then import that file to your new mysql database.
Since you have already moved everything over, you can just export the database tables from your remote server to a file, do the search and replace on that, and reimport it. When exporting the database make sure to check "Add Drop Table / Drop View".
It's very simple, do everything you need in local, when you're ready to deploy, export your local database from phpMyAdmin, open the file and do "search and replace" your local path with your server path.
Chnage the connection string inside config.php and you're done.
Related
I migrated my wordpress website into my local machine, but it's redirecting me to the original ,-server one-, website, immediately after I opennig the local one.
I try to describe what did I do as detailed as much I can:
First I got all wp files and copied-d it to my local XAMPP htdocs directory via SHH (FROM Linux Debian 10 - Apache 2 Webserver).
After that I exported the database (exported to sql file format).
I created the same database and user (with the same permissions as the server db user) in the local webserver
Everything went successfully, but after i want to open http://localhost/ I got redirected to my old site like https://originalsite.com
What did I tried to solve the problem:
I checked Apache, PHP and phpmyadmin version, but these are the same.
I reinstalled XAMPP but that also didn't solve the problem.
I checked wp-config.php but there aren't any options I've could been change, php.ini and my.ini both of them not gave me any alternative.
Thanks!
In the .sql file you imported, find "site_url" and change it to localhost URL. Or you can define it in wp-config.php file as "WP_SITEURL"
You will need to manually go in Database and Replace LIVE site URL with the Local URL.
Something like:
https://originalsite.com/
TO
http://localhost/originalsite
i have an wordpress website on my server but i don't own the domain anymore.
I can access to this site using total commander or filezilla but i can't access that page using google chrome. I want to copy that website. Is there any way to do that?
Yes, you can do few things like:
Files: From the FileZilla, download all Files
Database: From PhpMyAdmin if you have access download database, if you do not have that, then as you have FTP access, upload a lightweight mysql manager like this ONE file, https://www.adminer.org/ , upload it , and then give login for the database. You can get database login info from wp-config.php which you can access via FTP. And then EXPORT mysql database dump...
New Domain: Once you have both files and database, you can load them to any server or WAMP/LAMP on your local pc, and then do search replace for the URL from old domain to new domain like using , this awesome script: https://github.com/interconnectit/Search-Replace-DB
And it will make your site functional on new URL/Domain from existing site files and database.
I'm trying to restore a WordPress website for which I have the files backup, but I don't have a DB backup on hand.
I managed to get the site up partially by restoring the backup in cPanel - all the site's pages are working now, but because there is no DB in place (wp-config.php points to what 'used to be' my DB) accessing site.com/wp-admin renders this error:
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost. This could mean your host's database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
I know I made a huge mistake by not backing up my website DB.
Is there any way to be able to access wp-admin in this case? Can't I 'mock' the old DB with a new one? Anything to be able to access wp-admin.
Configure a core Wordpress with fresh installation point your current Wordpress files to the new database just got created
You should copy all the settings (from DB_NAME,DB_USER,DB_PASSWORD......AUTH_KEY,SECURE_AUTH_KEY..... till table_prefix) from your new installation wp-conf to old one
You would have lost almost all data stored in db like users etc however if your theme was more file based you should be able to se pages up
This is Triel and i think it should work to bes extent dont see any other way out of this scenario.
"Can't I 'mock' the old DB with a new one? Anything to be able to access wp-admin"
Simply Create a new mysql DB on your server and put its info in your wp-config.php file.
I deployed my website from server to my local machine using duplicator plugin. The deployment was successful (no errors). However when I am trying to open the website I get a blank page.
I am using latest version of MAMP server on windows machine. When I try to open http://localhost:8888, I automatically get redirected to http://localhost which is a blank page. Though I am able to access the dashboard through http://localhost:8888/wp-admin. How do I resolve this issue?
1- create index.html file with any text on your local server and try to access it via http://localhost to see if local server is working fine.
2- you need to export mySQL database from website & import to local mySQL server, because on server database urls and names are different.
I've tried looking around for a guide on moving a wordpress site into a dev environment, but all of the guides I've seen have been about CREATING one, as opposed to my situation, where I need to move an existin site to a local VM to create a dev/testing environment.
I'm fairly well-versed on how to create a dev environment from a regular old website, but just about everything wordpress-related gets me confused somehow.
Where I am now:
I've created a CentOS 6.0 VM using VMware on a Windows 7 machine. I've installed PHP, Apache, MySQL, and FTP-Server, along with all of the required updates and such. I have disabled SELinux.
I've moved the contents of the var/www/html/ folder from the live (production) server over to the var/www/html/ folder on my VM (currently exists within /var/www/html/my-website/)
My current issue:
When I attempt to access localhost/my-website/ I'm getting "Error establishing a database connection". An attempt at localhost/my-website/wp-admin/ tells me that either the database server is down (do I have to start this separately?) or that the username and/or password information in wp-config.php is incorrect (this was all simply moved from one place to another).
Any assistance would be greatly appreciated.
Have you updated wp-config.php to include your localhost and database info for your local dev environment?
I bet wp-config.php is still pointing to your remote server DB which the MySQL DB wont allow for external connections
Also, make sure that the dev is using the same domain as the live version. On my windows machine, I do this by changing my hosts file. I'm sure there is something similar on your VM.
If I am unable to do this and I need the dev version to be under a different domain I would do the following.
Create mysqldump of live database
Edit the dump and replace
all occurrences of livedomain.com with devdomain.com (if you dont do
this at least check the wp_options table for the livedomain.com
occurences.
Change wp-config.php database settings.
I always ensure to use the same domain (controlled by local hosts file), and same db config in my dev environment as in my live environment.
If you've not changed the wp_options table for (option_name = siteurl or option_name = home), then chances are if you type in devdomain.com into your browser it will redirect to newdomain.com
Hope this helps
Blake
I know this was been answered but just to be perfectly clear:
on Centos6 you need to run httpd with php, and the mysql server. In the mysql server you have to import the database dump from the live website then you have to edit the config in wordpress to match the username and password on wordpress.
now when moved the db does not keep the username and password so I suggest you do this
commands to be run in shell:
service mysqld start
chkconfig mysqld on
that will take care of the db server running
then edit wp-config with username root and no password (I am pretty sure you have not added a password at mysql-server install)
post in here if you need further help.