I already have a Magento 1 site but now I want to set up an additional Magento 2 site on the same server with that Magento 1 site.

Is it possible to do this thing?

  • 1
    I would not advise to do this. In every application there are different security risks, also in M1 and in M2. Putting two different applications on one server, means one application exposes the other to it's security risks and also the other way around. Always place one single application per server. – 7ochem Aug 10 '16 at 9:01
  • 2
    Possible: Probably yes. A good idea: No. As @7ochem mentioned above, security is one aspect why it's not a good idea to set up multiple shops/sites on the same server. Also M2 has other requirements to run fine (speaking of perfect conditions like PHP7 etc.) which won't probably match with your current M1 shop. Even though you would meet the technical requirements I would strongly advice against it. – Anna Völkl Aug 10 '16 at 9:19

There is a security risk to this. First start with...

Yes, this is possible

As your question does not specify anything, I'll list some things that are necessary to achieve this:

  • You'll need two document roots, two directories on the server, one to store the M1 code and one to store M2 code. I think it would even be possible for one of the applications to reside in a subdirectory of the other
  • You do not need two databases, but I would advise you to have them both run on their own database. If you run both on one database, you'll need to set different table prefixes to both M1 and M2.
  • As for minimum specs of the server, the M2 advised specs are much higher than for M1, so take the M2 specs as a starting point
  • You might have a problem with the right PHP version. M2 runs best on PHP 7, where M1 has some issues running on PHP 7. You can do 3 things here:

    • you could run PHP 5.6 (M2 minimum version)
    • you could run 2 PHP versions on one server (do not know how, Google it)
    • you could patch your M1 to be able to run on PHP 7

    I would go for the last option, this would also increase the performance of your M1 instance

Now second...

No, don't do it

As I said, there's a security risk to it. This risk exists whenever you setup two applications on one server, so also with setting up Magento 1 and Magento 2 on one server.

Each application has it's security risks and it's known and unknown vulnerabilities/weaknesses. So do M1 and M2. As both applications are quite different, they both have different security issues.

Whenever you setup two applications on a server, the security risks of one application are also exposed to the other application and visa versa.

Or more specifically: If someone has successfully hacked your M1 application, the attacker also directly has access to the M2 application.

I would not advise you to do this. You should always setup only one single application per server.

| improve this answer | |
  • 1
    Thank you so much for your answer! I will take a very careful consideration on this issue. – Harry Aug 11 '16 at 2:52
  • Thank you ! although this is some totally legitimate concerns, this is very useful for testing M1 modules alongside M2 module development, especially in case of limited ressources to allocate to two separate VMs, which could be considered overkill, don't you think ? – medmek Jun 19 '18 at 10:13
  • If your testing environment is shielded off from the big bad outside world, then everything is just fine ;) The discussion of resources vs. security will always be there. The security advisors will always say: "resources/money is no discussion when it comes to security. If you will have a breach, the costs of that are way higher!" – 7ochem Jun 19 '18 at 10:49

Yes, You can install Magento2 site on same server whether there will be Magento1 on that server. Just look at your hosting server Memory limit and Database limit.

And for installation please follow following links.

  1. Magento2 installation guide

  2. Magento2 installation guide

| improve this answer | |

Allthough 7ochem has written a very nice extended answer and had some legitimite remarks about this matter I believe it is perfectly okay to run both versions of magento on a single server as long as you split them up between two users of said server. The security issues in his answer are non-existent if both installations are setup correctly and separately. Ofcourse it's always advisable just to use the newest version of any CMS instead of a setup with both old and new. But it's definitely possible to set this up.

| improve this answer | |

You can do this with docker and containers.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.