You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将无法访问后台的Magento 1.9.2站点迁移至新安装同版本目录?

Absolutely feasible! Since you’ve got a fresh, fully functional Magento 1.9.2 instance up and running, migrating your old site’s data, themes, and extensions to this new environment is a perfect fix for your admin panel access woes. Let’s walk through this step by step to make sure it goes smoothly:

Is This Migration Feasible?

Short answer: Yes, absolutely. Using the same Magento version eliminates most compatibility risks, and since your new instance is already verified to work, this approach will let you bypass the admin panel issue from your old setup entirely.

Step-by-Step Migration Guide

1. Migrate Database Data

This is the core of your site’s content—products, orders, customers, settings, etc. Follow these steps carefully:

  • First, back up your old site’s database:
    • Use phpMyAdmin to export the full database, or run this command in your terminal:
      mysqldump -u [DB_USERNAME] -p [OLD_DB_NAME] > old_magento_backup.sql
      
  • Next, clear out the default data from your new Magento’s database (keep the database itself and user permissions intact).
  • Import your old database backup into the new database:
    mysql -u [DB_USERNAME] -p [NEW_DB_NAME] < old_magento_backup.sql
    
  • Critical Update: Fix the base URLs in the new database to match your new environment:
    • Open phpMyAdmin, navigate to the core_config_data table.
    • Find the rows where path equals web/unsecure/base_url and web/secure/base_url.
    • Update their value fields to your new site’s full URL (e.g., https://your-new-domain.com/—don’t forget the trailing slash!).
  • Clean up old cache and log data to avoid conflicts:
    • Truncate the core_cache, core_cache_tag, and all log_* tables (like log_customer, log_visitor).

2. Migrate Themes

Your custom or third-party theme files live in two main directories—copy both:

  • From your old site, copy the theme folder from app/design/frontend/[PACKAGE]/[THEME] to the same path in your new site.
  • Copy the corresponding static assets (CSS, JS, images) from skin/frontend/[PACKAGE]/[THEME] to your new site’s skin/frontend/ directory.
  • After copying, log into your new admin panel, go to System > Configuration > Design, set your migrated theme as the default, and save the configuration.

3. Migrate Extensions

Extensions add critical functionality, so make sure you copy all relevant files and verify their setup:

Third-Party Extensions

  • Copy the extension’s core code:
    • From app/code/local/[VENDOR]/[EXTENSION_NAME] or app/code/community/[VENDOR]/[EXTENSION_NAME] to the same path in your new site.
    • Copy the extension’s activation file from app/etc/modules/[VENDOR]_[EXTENSION_NAME].xml to your new site’s app/etc/modules/ directory.
    • If the extension has frontend/adminhtml templates, layouts, or static assets, copy those from app/design/ and skin/ directories as well.
  • Log into the new admin panel, navigate to the extension’s configuration page (usually under System > Configuration) to confirm settings are intact (most should be pulled from the migrated database, but double-check).

Custom Extensions/Custom Code

  • Copy all your custom modules from app/code/local/ to the new site’s app/code/local/ directory.
  • Copy any custom templates, layouts, or static assets associated with these modules.
  • Verify the modules are enabled: Check the active attribute in their app/etc/modules/ XML files is set to true.

4. Final Post-Migration Checks

Don’t skip these—they’ll ensure your site runs smoothly:

  • Clear the new site’s cache and session files manually:
    rm -rf var/cache/* var/session/*
    
  • Reindex all data: In the admin panel, go to System > Index Management, select all indexes, choose Reindex Data, and submit.
  • Test the frontend: Load pages, check products, categories, and content to ensure everything displays correctly.
  • Test the admin panel: Verify you can access all sections (orders, customers, product management) and that extensions work as expected.
  • Test critical workflows: Place a test order, check customer registration, and confirm any payment/shipping modules function properly.

内容的提问来源于stack exchange,提问作者Haris Khan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:18:56