Forums › Forums › OroCRM › OroCRM – How do I? Questions › How to take backup of and restore an OroCRM installation?
This topic contains 5 replies, has 2 voices, and was last updated by Dima Soroka 8 years, 8 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- June 24, 2015 at 2:05 pm #28451
Hi All
What is the right (and hopefully, easy) way of taking backup of an OroCRM installation (configuration and data), including custom entities? Equally, how to go about restoring from this backup – to either recover from a corrupt system or recreate the system?
Thanks!
- CreatorTopic
- AuthorReplies
- July 2, 2015 at 1:07 am #28452
DB dump and cache clear should be good enough.
August 4, 2015 at 3:03 pm #28453Thanks Dima; sorry I wasn’t able to get back to trying this out earlier.
I tried your suggested method but with no success. Below is what I did:
1. Took a database backup (from mysql command line)
2. Installed a completely clean instance of OroCRM – v1.7.5 with a blank database.
3. From mysql command-line, I restored the database from the backup I took in step 1.
4. Cleared cache on the newly installed orocrm application.
5. Tried to log in, but am getting an error: “Oro\Bundle\UserBundle\Entity\User::$avatar does not exist”.So you know, in my system, I had created some new entities (with many-to-many, many-to-one and one-to-many relationship with other custom and system entities.
Any ideas on what I am doing wrong or how to go about restoring my system?
Thanks
August 6, 2015 at 4:32 pm #28454You may need to take a look into upgrade instructions in case you had older version of application before. Please clarify, are you trying to move DB from staging/dev environment to some other one (production) with the same version of OroCRM or you trying to upgrade to latest version of OroCRM?
August 10, 2015 at 3:09 pm #28455Thanks Dima!
I was trying to move the DB from one environment to other, but was making the mistake of using the latest version of OroCRM on the new server.
As you noted, I have now tried upgrading the current server (using the instructions in upgrade.md) prior to moving the DB to the new environment, however, upgrade is failing at the last step with the following error:
PHP Fatal error: Uncaught exception ‘ReflectionException’ with message ‘Class Oro\Bundle\UserBundle\Entity\AbstractUser does not exist’ in /usr/share/nginx/html/orocrm/vendor/oro/platform/src/Oro/Bundle/EntityExtendBundle/Tools/GeneratorExtensions/ExtendEntityGeneratorExtension.php:58
Stack trace:
#0 /usr/share/nginx/html/orocrm/vendor/oro/platform/src/Oro/Bundle/EntityExtendBundle/Tools/GeneratorExtensions/ExtendEntityGeneratorExtension.php(58): ReflectionClass->__construct(‘Oro\\Bundle\\User…’)
#1 /usr/share/nginx/html/orocrm/vendor/oro/platform/src/Oro/Bundle/EntityExtendBundle/Tools/GeneratorExtensions/ExtendEntityGeneratorExtension.php(40): Oro\Bundle\EntityExtendBundle\Tools\GeneratorExtensions\ExtendEntityGeneratorExtension->generateConstructor(Array, Object(CG\Generator\PhpClass))
#2 /usr/share/nginx/html/orocrm/vendor/oro/platform/src/Oro/Bundle/EntityExtendBundle/Tools/EntityGenerator.php(85): Oro\Bundle\EntityExtendBundle\Tools\GeneratorExtensions\ExtendEntityGeneratorExtension->generate(Array, Object(CG\Generato in /usr/share/nginx/html/orocrm/vendor/oro/platform/src/Oro/Bundle/EntityExtendBundle/Tools/GeneratorExtensions/ExtendEntityGeneratorExtension.php on line 58So you know, I have a few many-to-many (and other types of) custom entity relationships with other custom entities (created from the UI) and system entities in the current system.
Any ideas how to fix this?
Thanks!
August 11, 2015 at 4:55 pm #28456Please make sure you disable cron and stop clunk server prior the upgrade.
- AuthorReplies
The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.