<div>It is the way it is intended.</div>If you create your own checkpoint you can specify what you want to be included in the backup.<div>/Dan</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 13, 2012 at 12:36 PM, Philip Clarke <span dir="ltr"><<a href="mailto:send2philip@gmail.com" target="_blank">send2philip@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Should it be possible to make a backup of tables in mnesia if you just have ram_copies ?</div><div>
<br></div><div>The documentation at <a href="http://www.erlang.org/doc/man/mnesia.html#backup-1" target="_blank">http://www.erlang.org/doc/man/mnesia.html#backup-1</a> does not seem to imply that there is any such limitation.</div>
<div><br></div><div>However when I examine the backup file created from mnesia:backup/1 it does not seem to have any table data.</div><div><br></div><div>I use this simple test to check the backup. It will fail with {aborted,{no_exists,bup_rec,all}}.</div>
<div><br></div><div><br></div><div><div>-record(bup_rec, {key, val}).</div></div><div><br></div><div><div>test_cannot_restore_backup() -></div><div> Node = node(),</div><div> mnesia:lkill(),</div><div> ok = mnesia:delete_schema([Node]),</div>
<div> mnesia:start(),</div><div> mnesia:wait_for_tables([schema], infinity),</div><div><br></div><div> OldBup = "old.BUP",</div><div> file:delete(OldBup),</div><div><br></div><div> CreateList = [{ram_copies, [Node]},</div>
<div> {attributes, record_info(fields, bup_rec)}],</div><div> {atomic, ok} = mnesia:create_table(bup_rec, CreateList),</div><div> mnesia:wait_for_tables([bup_rec], infinity),</div><div> OldRecs = [#bup_rec{key = I, val = I * I} || I <- lists:seq(1, 10)],</div>
<div> lists:foreach(fun(R) -> ok = mnesia:dirty_write(R) end, OldRecs),</div><div><br></div><div> mnesia:backup(OldBup),</div><div><br></div><div> mnesia:stop(),</div><div> ok = mnesia:delete_schema([Node]),</div>
<div> mnesia:start(),</div><div> mnesia:wait_for_tables([schema], infinity),</div><div><br></div><div> mnesia:restore(OldBup, [{default_op, recreate_tables}]),</div><div> ok = mnesia:table_info(bup_rec, all).</div>
</div><div><br></div><div><br></div><div>I would like to know if I am doing the backup wrong, or if this is something which is not supported.</div><div><br></div><div>Thanks</div><span class="HOEnZb"><font color="#888888"><div>
Philip</div>
</font></span><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>