We're currently rebranding a client of ours and it's come the time to take the new brand to their website.
I've not much experience with Drupal other than the theming (I've themed a Drupal website in the past but not very familiar with the software's inner workings).
As this website is live, it's obviously not feasible for me to make any changes to the live environment, so I have downloaded the source files of the website to a local webserver (MAMP).
I also have a MySQL dump of the database.
I'm not sure what files need to be changed inside Drupal to allow access to the MAMP webserver. Could somebody point me in the right direction here?
How would I connect the database to the website, which files need modification?
I think the client is running Drupal 6.
Update:
I've installed the database and linked it up using the below line:
$db_url = 'mysql://root#localhost/databasename';
I've hidden databasename for anonymity.
As it's MAMP, the database has no password. When I load up the website I get an error that install.php is not found. It's not there because the website is already 'installed'.
I've also updated the $base_url to read:
$base_url = 'http://localhost:8888/foldername';
You only need to modify one file, 'sites/default/settings.php'; you'll just need to change the database connection string in there to match your new database settings. There may be a couple of other settings in there you need to tweak depending on the set up of the site (for example the $base_url or $cookie_domain).
Other than that everything in your installation should be relatively path-ed so there shouldn't be any need to make more changes.
i was facing same problem after couple of hours try i got solution : we have to check the DB (tick on list of databases in local host) [ observe this after DB list : Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server. so enable only the db you want to use] this will redirect to http://localhost:8888/foldername/install.php successfully :D :D
Related
I was working on a website for a client a week ago and I came back to make further edits, but whenever I want to access the website, it reads:
Error establishing a database connection
I checked my wp-config file and everything is untouched; I did not touch one single line of code here when setting up my new Wordpress project in Local by Flywheel.
All my other local websites work except for this one. I've provided an image of my workspace just to make it more clear.
Looking at this image, the MySQL Version is a little bit off. The version should in fact be 5.6.37, but instead it's reading an older version of MySQL.
I did try closing and reopening Local by Flywheel, but it had no effect.
Any help appreciated. Thank you!
Right click on the site name and click on “Reveal in Finder” in Local by Flywheel.
Compress the folder containing all your site in a *.ZIP file (normally there must be at least the “app” and “logs” folder, sometimes “conf”).
In Local by Flywheel, import the site manually in FILE / IMPORT SITE, choose the Zip of your site
Normally, it reinstalls the site and recreates the Database … for me it’s work (on Windows and on Mac)
Are you able to compare your wp-config.php file in the broken site to a site that is using the same MySQL server?
I know you said that the file is untouched, but check again that all of the define parameters are correct.
Next I would suggest logging into your MySQL server using the credentials you have listed in the wp-config.php file and ensure you are able to access your database.
Assume I have asp.net websites on Server1 and need to move them to Server2, what is the best practice for this and how do I ensure that all relevant files, databases, etc are moved as well? Am I going to have to manually amend all the web.configs and other config files, plus find out what dependencies each site has, or is there a way to just export everything and import to the new server?
I have not found anything else on SO that has instructions for this.
Thanks
Edit: This is similar but not the same as the other question. The other question doesn't actually provide an answer, just some ideas about staging environments.
I'd like this to be as automated as possible due to having about 30 applications to move. The new server is pretty much identical but I noticed that when I moved one application using 'Web Deploy' as a test, it didn't bring over the dependencies and I had to manually find out which ones were missing and install them.
how do I ensure that all relevant files, databases, etc are moved as
well?
Typical asp.net sites have all data, and database under the one main directory. So you just copy/paste the full directory from the old to the new one server.
But we have some points to note here.
DataBase files are locked by the database, so you need to first remove them from the database.
In the new site you need to remount the database files and change the web.config according to the new server (eg, maybe new ip address, new names on database.
and finally the permissions on the new host must be correct and the same, if you have for example some directory that you need write permissions, you must add it also to the new server
You can also read: How to set correct file permissions for ASP.NET on IIS
After recent upgrade to latest WordPress version, media uploads no longer work. They return missing temp folder error.
I found out that WP thinks that /wwwroot/wp-admin/ is the temp folder, that's where it is trying to send uploads.
I tried everything to force it to change within WordPress. Setting WP_TEMP_DIR, even tried rewriting core function that looks for temp folder in /wp-includes/text/Diff.php and setting static path.
Nothing works. I don't really know much about Azure, so it's been a pain in the butt.
My last resort is to install and use Azure Storage plugin for WP, but that's last resort.
Anyone can shed some light on this issue? Would greatly appreciate it.
UPDATE: Site is a Azure website, it does not use Azure instance.
http://www.windowsazure.com/en-us/home/features/web-sites/
I'm not to sure about Azure but you can change the tmp directory WordPress uses by using the command below. Make sure to make a folder in your home directory before doing so.
wp-config
define('WP_TEMP_DIR','/link-to-your-folder-you-just-made');
First of all, you should never store anything on an Azure instance, consider it volalite storage just like RAM - if the instance goes down or even gets randomly restarted you could literally get a brand new virtual machine with a new file system and lose everything.
That being said, you can safely RDP into the instance - create a directory (c:\temp for example) and as long as the IIS account has rights over the directory you won't have any issues using it as scratch storage. I would use Andy's approach above (I don't know wordpress, but I know Azure) and simply make sure that it points to a directory that you can use as temp and that the IIS user can safely use.
You may want to log in to the VM with RDP if only for the additional reason that it will give you great insight in how Azure structures the file system for the software it runs, you will see 3 drives and if memory serves one of them is purely a scratch drive that you can use. But it's not persistent, consider that it can get cleared at any moment.
Hope this helps,
I am trying to create an identical wordpress website - on the same server. I need to create this as a testing environment but every time I try to duplicate the site it breaks. Is there an easy way to create a testing environment, of the live site, on the same server while keeping all of the same widgets, plugins and content?
I am an experienced web developer but a novice when it comes to Word Press.
I appreciate the help.
In my experience the following usually works:
Setup your prod site
Copy all files to the test site
Modify the wp-config settings as needed, and create the test db schema
Export all the data from the prod site control panel and import into the test site
The problem is that while you have all the files identically, your database contains all the configuration information for the live site. You'll need to copy the database from live to your development/testing server. You can run an export on the SQL and import the data into a new database. Then modify the wordpress/wp-config.php file in your development site to connect to the new copied database.
Additionally, you'll want to go through the new copied database, table: wp_options and change the site URL to match the development site/server instead of the live server.
Some default fields you'll want to change are:
option_name: home
option_name: siteurl
As well as fields installed by plugins that contain your site URL and path.
Create a directory for the testing.
Backup the original database, and
create another one (you may use the
same db user/pass if you like).
Execute the SQL file from the backup (at the test database)
Edit the wp-config.php.
(Test Database) Update the URL at the (your prefix)_options table. It's the very first value with the option name: siteurl
Done.
I am attempting to migrate hosts and am having issues migrating from one Drupal instance to another. I have a multi-site install. I am attempting to maintain the files/code as well as databases. I have transferred the files from the instance of Drupal from my old server to the new server. I have exported the databases via phpmyadmin and imported them back in with cli. For some reason the homepages for my sites work but the internal pages do not. When i try to navigate to a page I get The requested URL was not found. I have installed and ran a new instance of drupal 6 (same version) on the new server and it seems to work fine. I assume it is something I am doing wrong with the porting process? Any help greatly appreciated!
Did you transfer the .htaccess file(s) too ?
Those are "hidden" (their name is starting with a '.'), and not shown by default by some FTP transfer software...
(I've seen exactly this problem a couple of days ago, and getting the .htaccess from the old server and putting it on the new one saved the day ^^ so maybe you're having this problem too...)
You could have avoided that by only migrating the sites/ directory. Extract the latest version on your new server and copy the modules, themes, and settings from your old site. Of course the database will need to move also.
This assumes your site is up to date and you haven't modified the drupal core. You may have a custom install profile to copy over too.
There are some important things to keep in mind before migrating from one Drupal instance to another
1. Optimize the tables before exporting the database.
a) By clearing all the temporary tables
b) By removing website cache.
For more details go through the following link:
http://goldapplesoftware.ca/blog/2011-05-reducing-drupals-disk-temporary-table-usage
2. Export database with command line so no data is lost.
Check your httpd/apache conf file... be sure to add:
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>