Problem after migrating Magento - zend-framework

I am trying to create an exact mirror of a Magento production server on my local server for further development, but I have run into a few issues.
On the production server, our Magento is configured to run without displaying the index.php, but after attempting a migration to my local server, the index.php is required to access any links. Additionally, when I select a category to visit (for example), I am directed to http://localhost/category.html instead of http://localhost/my-magento-store.com/index.php/category.html
The other issue I've noticed is that I am unable to log in to the admin section. After entering the correct login credentials, I am redirected to the login screen again without any error messages.
I am running a MAMP stack on the local server, and here is what I have done:
Created a tar of the entire production server
Created a database backup in Magento System > Tools > Backups
Downloaded and extracted tar into local directory
Imported database dump into local MySQL using Alexey Ozerov's big dump script. (The .sql file is 1.3m lines)
Changed values of web/unsecure/base_url and web/secure/base_url in core_config_data table. (As I don't have a self-signed SSL cert, I put http://localhost:8888/my-magento-store/ for both values)
Dumped contents of var/cache and var/sesson
Changed permissions to 755 for all files on local dev server
Navigated to http://localhost:8888/my-magento-store/ but got the "Index of /" page instead.
Navigated to http://localhost:8888/my-magento-store/index.php and got an error.
Followed these steps to solve the error, reloaded the page, and the home page loaded correctly.
Any ideas?

URL Rewriting depends on your .htaccess file, so there are a couple of things to check:
web/seo/use_rewrites in core_config_data should be true.
when you created your tarball, did it include . files in the root directory especially .htaccess? If you used tar -cvf archive.tar * then it may have missed them. (Nice "feature" of *nix).
Check that your MAMP httpd.conf has AllowOverride All, otherwise your local .htaccess will be ignored.
I'm not familiar with MAMP, but it's possible that it's having a problem reading/interpreting your .htaccess, though this is unlikely. I'd focus on options 1 thru 3 first.
HTH,
JD

Related

Creating symbolic links resulting in 500 error

Currently running a WHM / Cpanel server running Centos. Server seems to be running fine no issues there. However I'm using a deployment process to put files outside of the document root. e.g.
~/deployment
instead of:
~/public_html
Obviously I need to point public_html to this folder so my site will run. So, I'm removing the public_html and creating a symlink and pointing it to the new deployment folder. This results in a 500 error.
So looking at the logs I've discovered that it produces the following error:
Directory "/home/xyz/deployment" is writeable by group
Checking the file permissions looks as though the symlink is 777 where i need it to be 755 for the server to allow viewing.
Is there a setting in WHM ? Is there a setting in Centos? I have another box running that doesn't have this issue so I'm assuming that this is related to the current setup of this machine.
Any help would be appreciated, thanks.
when you create a hard link from a file or folder, This file/folder inherits the accesses and permissions of the original file/folder, and in soft link it will be 777 permission, so i think you can use rsync options for both purpose :
1- have a folder with all files in source
2- have your own permissions in folder

PostgreSQL : .pcppass file not found, tried other links

I am working on installing PgPoolAdmin on my local ubuntu system for installing it on server later. Currently, I am able to login but I keep getting an error Could not read .pcppass fileFile not found. I have tried this and many other resources, but no luck. Where is it looking for this file?
The username and passowrd in pcp.conf is same as here, just its in plain text in .pcppass and md5 in pcp.conf. Is that correct?
pcp.conf I have on 2 location /var/www/html and /var/www/html/admin-tool/
Its contents :
#insert:hostname:port:username:password
*:*:akshay:PASSWORD
*:*:postgres:PASSWORD
Thank you.
.pcppass needs to accessible by the user that runs your web server. For example, if you are serving pgpoolAdmin through apache2 with default paths and users. The following should solve the issue.
cp ~/.pcpass /var/www/.pcppass
chown www-data:www-data /var/www/.pcppass
chmod 600 /var/www/.pcppass
By default a .pcppass file should be located in the user's $HOME directory. If you have created it elsewhere, then initialize the $PCPPASSFILE environment variable with the filepath. Make sure the file is in this format:hostname:port:username:password. Then you should be able to access the database.
Note: You cannot use wildcards in the password files, as it will give error sometimes. It is better to use exact host/port values for better security.

make server backup, and keep owner with rsync

I recently configured a little server for test some services, now, before an upgrade or install new software, I want to make an exact copy of my files, with owners, groups and permissions, also the symlinks.
I tried with rsync to keep the owner and group but in the machine who receives the copy I lost them.
rsync -azp -H /directorySource/ myUser#192.168.0.30:/home/myUser/myBackupDirectory
My intention is to do it with the / folder, to keep all my configurations just in case, I have 3 services who have it's own users and maybe makes modifications in folders outside it's home.
In the destination folder appear with my destination user, whether I do the copy from the server as if I do it from the destination, it doesn't keep the users and groups!, I create the same user, tried with sudo, even a friend tried with 777 folder :)
cp theoretically serves the same but doesn't work over ssh, anyway I tried to do it in the server but have many errors. As I remembered the command tar also keep the permissions and owners but have errors because the server it's working and it isn't so fast the process to restore. I remember too the magic dd command, but I made a big partition. Rsync looked the best option to do it, and to keep synchronized the backup. I saw rsync in the new version work well with owners but I have the package upgraded.
Anybody have some idea how I do this, or how is the normal process to keep my own server well backuped, to restore just making the partition again?
The services are taiga, a project manager platform, a git repository, a code reviewer, and so on, all are working well with nginx over Ubuntu Server. I haven't looked other backup methods because I thought rsync with a cron job do the work.
Your command would be fine, but you need to run as root user on the remote end (only root has permission to set file owners):
rsync -az -H /directorySource/ root#192.168.0.30:/home/myUser/myBackupDirectory
You also need to ensure that you use rsync's -o option to preserve owners, and -g to preserve groups, but as these are implied by -a your command is OK. I removed -p because that's also implied by -a.
You'll also need root access, on the local end, to do the reverse transfer (if you want to restore your files).
If that doesn't work for you (no root access), then you might consider doing this using tar. A proper archive is probably the correct tool for the job, and will contain all the correct user data. Again, root access will be needed to write that back to the file-system.

prestashop 1.6 localhost redirects to live url

I have a prestashop store.I have downloaded the source from ftp and imported the database as well.I want to set it up on my localhost.I am using wamp on windows 7.I have set my db credentials in setting.inc.php.When I access the front end it redirects me to the live url.The admin is ok ie its accessing through localhost.
I have edited the ps_shop_url table and changed the domain and domainssl to localhost and physical url to /myproject/.
I have also changed the ps_configuration table and changed PS_SHOP_DOMAIN = localhost and PS_SHOP_DOMAIN_SSL=localhost
I have also deleted my .htaccess file.
But the issue is still there.It redirect me to the live url.I have spent alot of time but in vain.Kindly help me I am new to prestashop.I have installed prestashop 1.6 version.
How to migrate PrestaShop from Your web server to local? (and inversely)
25 July 2015 Tutorials
That task is quite easy in most cases. But you must remember about few essential things.
Moving from SERVER to LOCAL PC
I assume you’ve configured PHP, Apache and MySQL on your local machine. If you don’t have those things installed, find some informations about how to do it. If you are using Windows I can suggest you installing XAMPP application.
Download all website files from your FTP and put them to the local directory.
Next, let’s export the database from phpMyAdmin to the .sql file and download it. Import that file to your local database.
Now it’s a time to make some changes in your local database, files and BackOffice.
Database:
Go to the table PS_SHOP_URL and change values of following columns:
– domain localhost
– domain_ssl localhost
– If your PrestaShop is located in some addictional directory, set the value of physical_uri (for example, if it’s in the ‘shop’ directory, write /shop/ there)
In the PS_CONFIGURATION table change the value of PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL
Files:
Set the debug mode ON in config/defines.inc.php
define('_PS_MODE_DEV_', true)
Set your local database parameters in config/settings.inc.php
If your PrestaShop is located in some addictional directory (for example /shop/), edit the .htaccess file. It’s located in PrestaShop main folder. Add to this part…
RewriteRule . - [E=REWRITEBASE:
1
RewriteRule . - [E=REWRITEBASE:
…that directory. Complete code should look like this:
RewriteRule . - [E=REWRITEBASE:/shop/
1
RewriteRule . - [E=REWRITEBASE:/shop/
BackOffice:
Advanced Parameters -> Performance
Select “Force compilation” in smarty settings, disable the cache and clear the cache using button located in upper right header of page.

How do I transfer a local Magento install onto my live server?

Uploading a Magento install
I have spent a long time building a store with Magento on my local development PC.
Now that I am happy with the result, I would like to upload it to my live production server.
What steps must I complete to ensure this move is as easy as possible?
moving files and database
I assume these two steps are obvious:
copy all of your local files to production server
dump your magento local db and import it into your production server db
editing in production server
now on your production server you need to follow these two steps:
edit app/etc/local.xml file and change database info
in production db,in its core_config_data table, you should find every records containing the url of your local installation, then you need to update those values;which can be found with this query:
SELECT *
FROM `core_config_data`
WHERE `value` LIKE 'http://%';
edit (thanks to comments):
3. Do not forget to delete var folder contents
4. Optionally remove this file too app/etc/use_cache.ser
Best way would be to make a fresh install.
Change the URL of the site to the live one before exporting the database.
Import your database into the live server.
Download and unzip the Magento files.
Edit the etc/local.xml file to set the database details.
Once you visit the URL, Magento will do all the required Database fixes and upgrades.
Copy the template into the folders.
Reinstall all modules (if you've used any).
You can move the site by other ways too... Check the following links.
Ref:
http://www.magentocommerce.com/wiki/groups/227/moving_magento_to_another_server
http://www.magentocommerce.com/wiki/how_to/moving_magento_to_another_server
http://www.magentocommerce.com/boards/viewthread/27272/
http://activecodeline.com/moving-magento-site-from-development-to-live-server
http://abhinavzone.com/moving-magento-site-from-development-server-to-live-server/
Don't change core files, instead either overload them via custom modules or, if absolutely necessary, replicate them in the app/local folder, which ensures that the modified versions get loaded instead of the standard files.
Deployment is handled like this:
I keep all Magento source files under version control, Subversion specifically. When I've tested my changes, I just submit them to the Subversion server and then export (or update) them on the production server. That way, I don't need to upload the whole site again, only the changed files get updated. Using the auto-installing extensions mechanism ensures that extensions are installed on the production server as they were on the development server. The only thing that's needed now is to adjust database settings for the new extensions on the production server (something that can also be handled by the extensions mechanism).
Its very easy to do, i did it and i made a document of it. all you have to do is add these lines in your sql file.
Place these lines of SQL code on very top of the .sql file:
SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT;
SET #OLD_CHARACTER_SET_RESULTS=##CHARACTER_SET_RESULTS;
SET #OLD_COLLATION_CONNECTION=##COLLATION_CONNECTION;
SET NAMES utf8;
SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET #OLD_FOREIGN_KEY_CHECKS=##FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET #OLD_SQL_MODE=##SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0;
Place these lines of SQL code on very end of the .sql file:
SET SQL_MODE=#OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=#OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=#OLD_UNIQUE_CHECKS;
SET CHARACTER_SET_CLIENT=#OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=#OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=#OLD_COLLATION_CONNECTION;
SET SQL_NOTES=#OLD_SQL_NOTES;
for more details
http://findgodaddyhostingreview.com/2010/06/how-to-move-magento-from-production-to-live-server/
You have to set the permissions to 755 to index.php and all folders.
Export magento database from localhost and import it in server MySQL.
Go to app/etc/local.xml . Change all attributes i.e. localhost, username, database name and password.
Open the file app/etc/local.xml.template . Change the respective attributes.
That's it. Hope it works for all. :)
If you want to move your installation form directory to top domain or one domain to another , you need to follow this setps.
1) Delete the content of the folder /var
2) Change the values of the file /app/etc/local.xml
There you can find your connection string data (database user, host and name).
3) Once you got your database uploaded, you need to make some changes.
Run this query:
SELECT * FROM core_config_data WHERE path = 'web/unsecure/base_url' OR path = 'web/secure/base_url';
You gonna get something like this:
+-----------+---------+----------+-----------------------+--------------------------------------+
| config_id | scope | scope_id | path | value |
+-----------+---------+----------+-----------------------+--------------------------------------+
| 2 | default | 0 | web/unsecure/base_url | http://www.tudominio.com.ar/magento/ |
| 3 | default | 0 | web/secure/base_url | http://www.tudominio.com.ar/magento/ |
+-----------+---------+----------+-----------------------+--------------------------------------+
Now, change that values for your new url.
UPDATE core_config_data SET value = 'http://www.tudominio.com.ar/' WHERE path LIKE 'web/%/base_url';
If you run the first query, now you gonna get something like this:
+-----------+---------+----------+-----------------------+------------------------------+
| config_id | scope | scope_id | path | value |
+-----------+---------+----------+-----------------------+------------------------------+
| 2 | default | 0 | web/unsecure/base_url | http://www.tudominio.com.ar/ |
| 3 | default | 0 | web/secure/base_url | http://www.tudominio.com.ar/ |
+-----------+---------+----------+-----------------------+------------------------------+
That’s all.
For more info visit : http://webdesignergeeks.com/cms/magento/move-magento-from-local-server-to-live-server-without-fresh-installation/
I find in web/unsecure/base_url in magecore_config_data database, if you search core_config_data and see it is empty table, please search something like magecore_config_data.
this mag that become in first part is asked of you when you install Magento as a prefix for Magento tables.
And one another point, I use wamp 2.2 and when I search databases in phpmyadmin that filtered only databases in that page, please change pages and search again.
I follow this tutorial http://magentoexplorer.com/how-to-move-or-transfer-magento-from-localhost-to-live-server and succeeded to move my Magento installation from Localhost (XAMPP) to live server. Simply, you can follow these 5 steps:
1. Export database of Magento site (SQL file)
Open PHPmyadmin to export your database to SQL file or you can run this command from SSH mysqldump -uUSERNAME -pPASSWORD DATABASE > backup.sql
2. Upload code of Magento site to live server
Upload all files/folder from your localhost to live site using FTP client, you can zip and unzip file to make sure all files are preserved
3. Import database to live server and change database configuration.
Again, use PHPmyadmin to import the .sql file we export in step 1 or run this command from SSH mysql -uUSERNAME -pPASSWORD DATABASE < backup.sql
4. Replace local URL with live site URL in database
Find the table core_config_data and edit url in column web/unsecure/base_url and web/secure/base_url to the domain of your live site
5. Pointing your domain to server’s IP
Hope this helps
After completion of building an eCommerce website in localhost with lots of efforts configure all other settings in localhost. Some of them are struggling to Upload their store from localhost to live server, where even our team faced this problem in the beginning.
HOW TO UPLOAD MAGENTO SITE FROM LOCALHOST TO LIVE SERVER
Now from this tutorial, I am going to show you how to successfully Upload Magento site from localhost to live server. Here are the most important steps to make your shop live from localhost to your live production server.
Step 1: Make a zip of your Magento Working Files.
Select Magento working files from your local server. And then Just go to htdocs folder( if XAMPP) or www folder ( if WAMP) later go to Magento folder and then compress all the files in the zip folder.
Step 2: Open your Database using phpMyAdmin
Open your control panel (Xampp/Wamp) and Start Apache and MySQL. After that, visit localhost/phpmyadmin and then open your Magento Database.
Step 3: Type these SQL query:
Here I have used m22 as my database name
Select * from m22.core_config_data where value like ‘%127.0.0.1%’
Step 4: Change 127.0.0.1 or localhost to your domain URL
After entering the query in SQL command line you will find a result in phpMyAdmin window. Change 127.0.0.1 or localhost to your domain URL as shown in below images.
Example:
UPLOAD MAGENTO SITE FROM LOCALHOST TO LIVE SERVER
Step 5: Export MySQL full database
[3]
After completing your previous step, you have to Export/dump your full database. In our case we used Xampp shell command prompt to dump the database as shown in below images.
Example: Export using Xampp shell command prompt
HOW TO UPLOAD MAGENTO SITE FROM LOCALHOST TO LIVE SERVER
Step 6:Create Database in C-panel using username and password
After Logging into your C-panel. Create new database with username and password credentials in MySQL database wizard.
Step 7: Upload the Database files
Upload localhost database file (From Step 5) in phpMyAdmin using C-Panel
Step 8: Upload the zip file in file manager
Upload Magento working files (From Step 1) in File Manager using C-Panel
Step 9: Connect your Magento file with your database
After uploading your Magento work file, Go to app folder and follow the steps given below:
Go to root folder -> app -> etc -> local.xml.sample
Rename local.xml.sample to local.xml
Change the user credential (username and password given in database from
Step 6)
[4]
<host>your_host_name]]></host>
<username>your_user_name]]></username>
<password>your_database_password]]></password>
<dbname>your_database_name]]></dbname>
Save the changes
Example: HOW TO UPLOAD MAGENTO SITE FROM LOCALHOST TO LIVE SERVER
Step 10: Create and clear cache memory
Create _cache folder in Magento -> var
Open the cache folder in Magento- > var and select all cache files and then choose delete.
Step 11: Change cache directory
Create a temp folder in Magento
Open magento/lib/Zend/Cache/Backend/File.php and look for:
protected $_options = array(
‘cache_dir’ => ‘null’,
Change it to:
protected $_options = array(
‘cache_dir’ => ‘tmp/’,
Save it.
Step 12: Clear browser cookies and reload the page
After you have done all the above steps successfully, your Magento site is now completely uploaded on your own domain from localhost. Now you can check in the browser by entering your domain name and press enter. You are now amazingly viewing your online store if you have completed all above steps as mentioned. Now the online Store looks exactly what you viewed in your localhost.
for more information visit : http://www.instasoftech.com/blog/how-to-upload-magento-site-from-localhost-to-live-server/
I recently moved a full Magento install complete with a couple of extensions. I found it as simple as copying the directory structure, changing the BASE_URL in config_data and changing the database info in 'local.xml'.