Announcement

Collapse
No announcement yet.

Always make a backup before upgrading

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #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;
    }
    }



    Comment

    Working...
    X