public function backup()
    {
        $packageHandle = $this->getPackageHandle();
        $errors = $this->app->make('error');
        if ($packageHandle === '' || !is_dir(DIR_PACKAGES . '/' . $packageHandle)) {
            $errors->add($this->getErrorText(self::E_PACKAGE_NOT_FOUND));
        } else {
            $config = $this->app->make('config');
            $trash = $config->get('concrete.misc.package_backup_directory');
            if (!is_dir($trash)) {
                @mkdir($trash, $config->get('concrete.filesystem.permissions.directory'));
            }
            if (!is_dir($trash)) {
                $errors->add($this->getErrorText(self::E_PACKAGE_MIGRATE_BACKUP));
            } else {
                $trashName = $trash . '/' . $packageHandle . '_' . date('YmdHis');
                if (!@rename(DIR_PACKAGES . '/' . $this->getPackageHandle(), $trashName)) {
                    $errors->add($this->getErrorText(self::E_PACKAGE_MIGRATE_BACKUP));
                } else {
                    $this->backedUpFname = $trashName;
                }
            }
        }

        return $errors->has() ? $errors : $this;
    }