Drupal Site is very Slow after migrating - php

I migrate a Drupal website from live server to my staging server.
Ist
I export full database and import in local and delete all cache tables data.
2nd
I download zip file of code and upload in staging server and change database username , pass in setting.php file
Now My web site at staging is very very slow it takes upto 5 minutes to load any page
can any one let me know where I make mistake in migration and now how I can make fast my site at staging. I think it is not reason of staging server because same site at my own machine is also slow when I setup it on my local machine. same site is very fast at production server.I am new to drupal please anyone point my mistake where I make mistake so site is slow

Check error logs (Drupal's "Recent log messages" under the "Reports" menu, as well as PHP error logs and Apache logs on your server). Use Firebug in Firefox, or dev tools in other browsers to see if some assets (images, CSS files, JS files) are missing.

Related

Trying to work on a client's Drupal site from my local machine

I have a client who wants me to update their Drupal site. I've never done this before, and I want to work on it from my local machine just in case something goes wrong. I have no idea where to even start!
First off, how do I access my client's site files so I can get them onto my computer? I've tried entering the information the client gave me into Cyberduck, but it won't give me access. Is there another way to get access?
Also, how do I host it locally? I have XAMPP, but I'm not sure how to use it.
That being said, I have found a few forums that should help me set up the local server. I just don't know how to get the files from the live server to my computer.
I know this is a super noob problem, but I could use the help. Thank you!
Well, for the basic question, you have to get the correct credentials from your client. There's no alternative, really :D
While you're at it, you'll want a copy of the site's database too.
For the question "how do I host it locally?" Here's how I would go about it.
Get the site into version control.
Given that you were given (S)FTP credentials, I'm guessing the site is not version-controlled. If that's correct, then that is probably the very first thing you want to do. This will allow you to keep track of the changes you've made on your local site that are different to the production version.
Create an empty directory on your computer.
Navigate to the directory in a terminal and run git init.
Add a .gitignore file to that folder (you can create your own, or use one customized for Drupal).
Download the site's files into the directory created in step 1.
Add the files from the in the directory to the git repository by running this command in a terminal: git commit -am "First commit of Drupal files to repository."
There's a good help page about working with Drupal in git on drupal.org.
Create and populate your database.
Get a database dump from the live site.
Create a new database and database user on your machine.
Import the database dump into your new database.
Record the database credentials in settings.php or settings.local.php and store them somewhere safe, preferably in a password manager.
Change the database credentials in settings.php or settings.local.php to match the credentials of the database you've just created.
(For safety and to avoid confusion, I always create local databases with a different name, user, and password than the live site has. This means if your local credentials are compromised, the live site isn't, and it means you can't connect to and change the live site's database by accident.)
Set up the webserver in XAMPP
Create a new site in XAMPP called e.g. example.local that points to the directory that contains the file index.php
Add the following line the file called /etc/hosts on your computer:
127.0.0.1 example.local
Test that this works in a browser by visiting e.g. http://example.local or http://example.local/robots.txt.
Move your local changes to the Production site
How you will be able to do this depends to some extent on your client's web-hosting infrastructure, and what version of Drupal your client uses. but in any case, you will have three separate concerns for changes you make:
Code changes
You will need to deploy changes you make to the code back to the server. Ideally you would probably do this via Git either by cloning directly into the live site or (far better!) as part of an automated build process. By the sound of it, you may just have to FTP the changes back up.
Be careful not to re-upload your modified settings.php or settings.local.php file!
Content changes
You probably have to test some/all of your content changes locally and then recreate them on the live site. Because your client may have made changes to the live site while you were working, you can't risk importing your local database into the live site.
Configuration changes
Changes to configuration should be managed in code (i.e. as part of 1. Code changes above) if that's possible. In Drupal 7, the Features module is usually the best way to accomplish this (here's an answer I wrote describing the Features workflow). Drupal 8 has the Configuration Manager. Be aware that these two tools can both be tricky to use well.
Your client needs to gave you access to the files so you can put them into htdocs on XAMPP, then you need the database (also provide by the client), start XAMPP, create a new database on localhost/phpMyAdmin and import the db of the site. On the proyect code go to sites/default/settings and change the db settings to your local settings. Then you can go to localhost/{your-proyect} and it should work.

Using Xampp and 'git' for team web development in wordpress. Database issue

me and a coworker are trying to move a website from a test server to local web development. Our boss wants us to use Amazon web services CodeCommit in conjunction with Xampp to do this. We have made progress but cannot overcome a database issue. Here is what we have done.
Set up AWS accounts and recieved necessary credentials from boss for the sites repo
Pulled repo and ensured that we could both commit and pull normally
Downloaded xampp, made sure apache and php were functioning normally
Now, one of us (me) has used the duplicator wordpress plugin to backup the site and load it into a local version.
I can now develop locally fine and push changes, all images and pages from the site are showing up locally
ISSUE:
How can my coworker also develop locally, the issue appears to be that he has not made a database in xampp phpmyadmin control panel for the site, but if he did wouldnt it be a different one than I am using, and thus wouldnt sync with git properly? Where xampp stores the database info isnt in the git folder, so I may be doing it wrong as well!
We cannot figure out the correct course of action, please if you can point us in the right direction. Much appreciated!!

No images are being displayed after migrating drupal website from server to local host

I'm trying to replicate drupal website in my localhost. I have copied all the files from public_html folder and mysql database. I have also updated my database details in settings.php file and deleted all contents of .htaccess file under site folder. But still I'm not able to crack down. Please suggest some solution.
N.B: Also tried refreshing the cache.
Please check your network information with your debug window of the
browser. then you can identify loading failed resources. so you can
troubleshoot your self.
See the network resources information with google chrome.
Goto Menu -> More Tools -> Developer Tools, Then click Network tab. Refresh the page again. Then your resources will be listed as follows.
Make sure your base_url is defined and all thr content are copyed successfully.
Setup a test-site database with phpMyAdmin
Change settings.php (or includes/conf.php) in your backed-up Drupal files.
Upload the backed-up Drupal files to a test-site folder on your server
Check if your test site works.
Get ready for the basic steps.
How to copy live site to local server

Creating a test environment for an existing website

So I have an employer who currently operated their website with no testing server whatsoever. All updates to the site are "tested" live in front of the whole world. I don't need to hear about why that's dangerous... I know it is. In fact if this continues for much longer I'm going to develop an ulcer.
I am trying to place a working copy of the svn of the site on my MB pro for testing purposes. The site is all PHP and MySQL so my plan is to install MAMP and run the test copy on localhost.
My employer is worried that by hosting a copy of the site on my laptop I will interfere with the operation of the live site. Is this possible? Is there any way that my hosting a copy of the site on localhost will interfere with the operations of the live website (hosted on a remote server)? Are there dangers in setting up a localhost copy?
Apologies if this is out of scope, hopefully this will be useful to others.
It depends on the site. When I make a site and the database is hosted on localhost / the same server as the web-server, no.
But I have noticed that if you use for example WordPress, you are testing on your local copy one minute and are on the live site the next as the url seems to be hard-coded in the generated pages (in the case of WordPress a setting in the database).
So:
Always make sure the database connection is to your local database (ideally that is just in one place and you don't have to change anything if the live site uses localhost as well)
Look out for links / settings / rewrites that direct you to the live site from your local site.

How to make desired Joomla site working on live server same as on Local Machine?

I have created a Joomla based website and willing to upload it on live server. I have never done the hosting before. please help me how shall i make this happen successfully?
There is a much easier way to do this. Look for a component called Akeeba Backup. Install that on your local Joomla install. Then create a backup of your site.
Now using the backup from Akeeba your can restore your site onto any other server - live or test. The restore feature of Akeeba has a installer that is similar to the Joomla installer.
Very simple, very effective!
Database. You have to export your database from your local machine to the remote one (using phpMyAdmin for example)
Copy files. Copy your local files to the remote server. (using FTP for example)
Configuration files check. Some paths are hardcoded in it, and database credentials might be changed.
See also http://docs.joomla.org/Copying_a_Joomla_website

Categories