# Feature OP-8458 - Back up and restore single projects | backup

Project: OpenProject
Status: new
URL: https://community.openproject.org/work_packages/OP-8458

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | Wish List |
| Sprint |  |
| Backlog bucket |  |
| Votes | 21 |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | Yes |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by | Express (8754) |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** an administrator / project administrator  
**I want to** create backups on a project based level  
**so that** project states can be saved and restored individually, without affecting other projects.

**Background**

  - OpenProject backups can be created for the entire OP system only. Most likely you have plenty of projects in your OP database, but there's no way to create backups for just one project.
  - So it's not possible to restore a project without restoring *all* projects.
  - That's why we're suggesting an SQL based backup and restore mechanism.

**Idea / Solution**

Roughly said: Creating a project based backup could be performed by feeding tables like this (rudimental pseudo code)

``` SQL
SELECT * INTO myProjectBackup
FROM projects
WHERE project_id = 47
```

... followed by similar queries for all related tables containing references to project\_id 47 (work\_packages, types, statuses, assignees, many more)

Restoring would be done by first clearing any existing entries belonging to the project in question and inserting the contents of myProjectBackup afterwards, like so:

``` SQL
DELETE FROM projects WHERE project_id = 47
SELECT INTO projects
FROM myProjectBackup
```

Again, this would need to be done for all related tables, as described above.

Though this might appear cumbersome on first sight, actually it's only a set of SQL statements reflecting the table dependencies.

As a desirable extra, this functionality would be integrated into the OP GUI. :D
