> For the complete documentation index, see [llms.txt](https://ajuda.pdvlegal.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajuda.pdvlegal.com.br/pdv/configuracao-do-pdv/limpeza-do-banco-de-dados.md).

# Limpeza do banco de dados

{% hint style="danger" %}
**Pré-requisitos:**

1. **Backup dos dados:**
   * *PDV > Configurar > Backup dos Dados > OK*.
2. **Sincronizar vendas:**
   * *PDV > Vendas > +Funções > Sincronizar*.
     {% endhint %}

***

**Passo a Passo para realizar uma limpeza no banco de dados:**

**1 - Acessar a função de limpeza:**

* *PDV > Configurar > Limpeza Banco*.

**2 - Obter a chave de segurança:**

* Acesse **Retaguarda Cloud > Administrativo > Filiais > \[Sua Filial] > Meus Terminais.**
* Clique no **ícone de informação (ℹ️)** do terminal desejado > Copie a chave (validade: **1 hora**).

**3 - Executar limpeza:**

* Insira a chave no PDV > Confirme a operação.

<figure><img src="/files/h3eVCzJcQvnpOX4x4lEG" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Após a limpeza:**

* **Dados removidos:** Histórico de vendas local.
* **Dados preservados:** Cadastros, configurações, produtos.
  {% endhint %}

***

### Resolver problemas comuns

{% hint style="danger" %}

* **Problema:** Chave de segurança inválida.
  * *Solução:* Gere uma nova chave no Retaguarda Cloud (ela expira a cada 1 hora).
* **Problema:** Dados não sincronizados.
  * *Solução:* Repita a sincronização (*+Funções > Sincronizar*) antes da limpeza.
* **Problema:** Limpeza não concluída.
  * *Solução:* Reinicie o PDV e repita o processo com uma chave atualizada.
    {% endhint %}

***

### Dicas rápidas

{% hint style="success" %}

* **Agende a limpeza:** Faça fora do horário de pico para evitar interrupções.
* **Verifique o backup:** Confira se o arquivo de backup foi gerado (*PDV > Configurar > Backup*).
* **Uso do Compartilhador:** Após a limpeza, configure o Compartilhador para centralizar dados em múltiplos PDVs.
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ajuda.pdvlegal.com.br/pdv/configuracao-do-pdv/limpeza-do-banco-de-dados.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
