# Restarting Aerospike server deletes all data

**URL:** <https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467>\
**Category:** General Discussion\
**Created:** [February 4, 2016, 6:56pm UTC](https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467 "2016-02-04T18:56:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chipmunk1101](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/chipmunk1101/32/106_2.png) [@chipmunk1101](https://discuss.aerospike.com/u/chipmunk1101)\
**Post date:** [February 4, 2016, 6:56pm UTC](https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467/1 "2016-02-04T18:56:29Z")

</div>

After I run the command `sudo service aerospike restart` all the data in the namespaces gets deleted.

I am running on a Ubuntu 14.04 machine with Aerospike Community Edition build 3.6.2.

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [February 4, 2016, 7:11pm UTC](https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467/2 "2016-02-04T19:11:04Z")

</div>

Is your namespace defined as `storage-engine memory`? By default that’s what it is, and without persistence, so unless you modified your default aerospike.conf that’s the expected behavior. Useful for development.

Please share your config, if not.

---

<div class="post-metadata">

**Author:** ![chipmunk1101](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/chipmunk1101/32/106_2.png) [@chipmunk1101](https://discuss.aerospike.com/u/chipmunk1101)\
**Post date:** [February 4, 2016, 7:13pm UTC](https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467/3 "2016-02-04T19:13:23Z")

</div>

This is the config I am using. I am storing data in-memory alongside with in a file.

```auto
service {
        user root
        group root
        paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
        pidfile /var/run/aerospike/asd.pid
        service-threads 4
        transaction-queues 4
        transaction-threads-per-queue 4
        proto-fd-max 15000
}

logging {
        # Log file must be an absolute path.
        file /var/log/aerospike/aerospike.log {
                context any info
        }
}

network {
        service {
                address any
                port 3000
        }

        heartbeat {
                mode multicast
                address 239.1.99.222
                port 9918

               interval 150
                timeout 10
        }

        fabric {
                port 3001
        }

        info {
                port 3003
        }
}

    namespace polls {
            replication-factor 2
            memory-size 4G
            default-ttl 0 # 30 days, use 0 to never expire/evict.

            #storage-engine memory

            # To use file storage backing, comment out the line above and use the
            # following lines instead.
           storage-engine device {
                   file /opt/aerospike/data/polls.dat
                   filesize 16G
                   data-in-memory true # Store data in memory in addition to file.
    # scheduler-mode noop
           }

```

---

<div class="post-metadata">

**Author:** ![chipmunk1101](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/chipmunk1101/32/106_2.png) [@chipmunk1101](https://discuss.aerospike.com/u/chipmunk1101)\
**Post date:** [February 4, 2016, 7:18pm UTC](https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467/4 "2016-02-04T19:18:03Z")

</div>

Will there be an issue if I delete the storage backing file, in my cases polls.dat and then restore from a backup?

Because I noticed that this issue occurs only when I manually delete the .dat file and restore.

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [February 4, 2016, 7:33pm UTC](https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467/5 "2016-02-04T19:33:52Z")

</div>

Wait, you stopped the server, removed the dat file, then tried to restart? If you take away the file it has no copy of the data. DRAM is volatile, obviously.

---

<div class="post-metadata">

**Author:** ![chipmunk1101](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/chipmunk1101/32/106_2.png) [@chipmunk1101](https://discuss.aerospike.com/u/chipmunk1101)\
**Post date:** [February 4, 2016, 8:04pm UTC](https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467/6 "2016-02-04T20:04:44Z")

</div>

No no.

I removed the file while the server was running then restored Aerospike(the file is automatically created here) and then restarted the server. Now, the data goes off.

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [February 4, 2016, 8:17pm UTC](https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467/7 "2016-02-04T20:17:27Z")

</div>

Well, you can’t remove the persistence file while the server is running.

---

<div class="post-metadata">

**Author:** ![chipmunk1101](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/chipmunk1101/32/106_2.png) [@chipmunk1101](https://discuss.aerospike.com/u/chipmunk1101)\
**Post date:** [February 5, 2016, 11:49am UTC](https://discuss.aerospike.com/t/restarting-aerospike-server-deletes-all-data/2467/8 "2016-02-05T11:49:10Z")

</div>

Okay. Got that.

The way I got into this issue is one of the machines got restarted which had a single node Aerospike cluster running. When the server came back on, all the data was missing.

What I did next is delete the namespace file and asrestore from an old backup. After backing up and restarting the machine did not delete the data this time,
