I want to run a project from a client locally for development for obvious reasons.
This is a Magento shop and I've made a copy of the /public folder and the database. Put the /public contents in a Homestead box and imported the database, as it should work just fine for other non-laravel projects which use PHP, MySQL etc, right?
I changed the secure and insecure URL's in the database config table and it seems to work mostly.
The only problem seems to be that when I go to sitename.app:8000/admin it opens the admin page, but when I log in, it redirects to sitename.nl/admin, so the live version..
How does this happen?
I seem to have fixed it already!
go to /public/var/cache and delete all the contents.
First load will be slow because it has to regenerate them but the links will now work as expected!
Related
We have a dev site www.dev.site.co.za & a live site www.site.co.za.
I wanted the dev site updated to be a current replica of the live site, so our hosting provider copied it over.
But now when if you go to www.dev.site.co.za, you are "redirected" to www.site.co.za. I have tried changing the siteurl in phpmyadmin but that hasn't resolved the issue.
Is there somewhere else the url needs to corrected and is there anything else I need to do to make sure the dev site is a completely separate environment to the live site so I can safely fiddle without damaging the live site?
wordpress not only uses the database in PHPMyAdmin for the url.
As mentioned in the official documentation there are several files that can include the url:
the wp-config.php (wordpress file)
the functions.php (theme file)
Check these and have a look for the url address.
Have a look at the .htaccess file!
Also:
Helpful for that issue (e.g. restoring a wordpress page on another server) is the plugin BackupBuddy. It is one of the most well known plugins for wordpress. (Know right now that it is a paid version! But as always there are others with the functionality).
It allows you to backup and restore your page on a new system. You can initially set your new desired address for the system then.
Maybe it is worth a look!
For rectifying your dev site issue, you can try this.
Following is the URL to a simple utility via which you can replace some value in your database with some desired value.
https://github.com/interconnectit/Search-Replace-DB
Download the utility (zip file).
Upload it to your dev site root location and unzip it there. So that the the URL of the unzipped folder becomes: www.dev.site.co.za/Search-Replace-DB-master/.
Visiting that URL will show you the screen with options to replace some values in your database with desired values.
This utility automatically selected the connected database.
Put the URL of your live site in the field to replace.
Put the URL of your dev site in the field to replace with.
Choose the Dry Run option to see what all tables and columns will be affected.
Once you see the results and know what is changing then you the click on Live Run.
Clicking on Live Run will change all the URL of your live site in dev site database with URL of your dev site.
Once the changes are done you can delete this folder.
Hope this will at least resolve the problem of redirection of dev site to live site.
Once the new site is built you can then migrate(move, copy) it to the live site's location. There are some tools out there to help with moving the site you can use once the site is done. Some require a plugin to be installed to do that though. For example magicmigration can be used to move the completed site to a new location (that one specifically doesn't take extra installs). It is also possible to manually migrate the site though depending on the situation and know-how that can be a bit much for some people.
I just migrated my website and it keeps rederection to another domainname of mine. Before I did this I open de SQL file and replaced the old domain with the new one. And imported it this in a new database. After that I configured the wp-admin. So after done this it should work right? In can access the website through wp-admin and that seems to work, but when I just type in the URL it rederection to another old domain of mine.
Anyone any idea how to fix this?
Seems like you missed some records in the database. The best approach is to use a tool like https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
If you download this free tool and upload to your server then it does a batch find-and-replace across every single table in your Wordpress database.
So, for example, replace http://www.example.com with http://sub.example.com
You can do a dry run and it will show you all the replaces that it will make. Once you're happy then click the "live run" button and all the changes are made.
I use this tool all the time when I am moving a site from my local machine to the live server. I also use the exact same approach when migrating a site from http to https
Using Wordpress-Heroku and ran into some issues. Changed my app name from heroku's autogenerated name to something more descriptive, but /wp-admin gets redirected to the old name. Of course there's no such app anymore. Also tried to set up a local version but found that going to localhost:8888/wp-admin redirects me to app on heroku.
I guess that something in the installation process creates permalinks to the site address in the database. Is there a way to fix this without resetting the installation?
I change servers (copying live sites to localhost) fairly frequently following the Codex. While not on Heroku, I assume the process would be the same.
In your case, the Search and Replace for WordPress Databases Script mentioned should do the trick (after backing up the database, of course).
I assume you've updated your wp-config.php to point to the new database.
I've got a Magento store that refuses to keep session information on the front end. Strangly the admin works fine. PHP independent of Magento is able to write sessions. Magentos var/ directory is writable by the webserver. I can even see files being written to var/session.
This site is running on ec2 under nginx. I wasn't having these problems previously under Apache and as far as I can tell the configuration of Magento itself is the same.
Yes this was it. I wasn't able to see this in the Firefox console, but in Chrome I could see the domain was wrong ( although it looked ok in the admin, but maybe I was confused ) updated all cookie_domain fields in core_config_data table and its working. Thanks #datasage
I am making changes on a website database I am developing using joomla 2.5 , but these changes are not reflected on the website.
I dumped the database and run it on the same version of the website locally and it is working very fine with the changes , I have only one database on the webserver so no doubt that I am changing on other database , when I changes the database password the website went down
I am installing my joomla web application on a godaddy webserver and I also cleared the cache to make sure that it is not the problem.
the changes are on a modules and also on the articles
Just out of curiosity, are you are you are editing the correct database? I only say this as I have a similar problem where I was registering test accounts on my site and couldn't see the rows being added to the database cause I was looking at the Wamp Server one, not the online one.
If noting what so ever is happening like you said, try changing the database table prefixes but do not update the config.php and see if this throws an error when you try and preview the site.
I think Database changes which you are making are module specific and they arte getting which you are re-initialized while accessing module through init function of module. You can change values over there also