Always make a backup before upgrading

Collapse
This is a sticky topic.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yuri
    Member
    • Mar 2014
    • 8438

    Always make a backup before upgrading

    To be able to roll back if your instance stopped to work after upgrade.

    Last edited by yuri; 10-06-2021, 08:40 AM.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #2
    Hello Yuri,

    Maybe can you integrate this in upgrade process ? I know you have provide backup script.
    (my backup is not accessible by http .... maybe it's "risk" for newbee)

    i have make a job for this : (deleted path)

    PHP Code:
    <?php
    
    namespace Espo\Custom\Jobs;
    
    use Espo\Core\ORM\{
    Entity,
    EntityManager,
    ServiceFactory,
    Jobs\Job,
    };
    
    class BackupJobs extends \Espo\Core\Jobs\Base
    {
    
    public function run()
    {
    $GLOBALS['log']->warning( "BackupJobs Begin : " .date('Y-m-d') );
    $pdo = $this->getEntityManager()->getPDO();
    $sql = "DELETE FROM scheduled_job_log_record WHERE status='Success';DELETE FROM job WHERE status='Success'";
    $sth = $pdo->prepare($sql);
    $sth->execute();
    
    @exec('bash ./backup.sh > /dev/null &');
    $GLOBALS['log']->warning( "BackupJobs End : " .date('Y-m-d') );
    return true;
    }
    }



    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    Working...