Skip to content

Instantly share code, notes, and snippets.

View tobz's full-sized avatar
💁‍♂️
it me

Toby Lawrence tobz

💁‍♂️
it me
View GitHub Profile
@tobz
tobz / steps.md
Last active August 21, 2026 12:08
Migrate Radarr from SQLite to Postgres

Migration steps

  1. Upgrade Radarr to at least v4.1.0.6133 or newer. This brings in support for Postgres. This will also ensure that all of your SQLite tables have the latest schema migrations applied before we migrate to Postgres. If you want to upgrade further, that's fine too, but make sure you've completed all upgrades first before continuing.
  2. Create your Postgres databases (one for the "main" database and one for the "logs" database) and configure Radarr with the relevant Postgres credentials. Both databases need to be owned by/accessible from the same Postgres user.
  3. Restart Radarr, and ensure it connects to Postgres and runs all schema migrations.
  4. Once all schema migrations have been applied, and no other activity is occurring, stop Radarr.
  5. Copy the SQLite databases from the Radarr instance/pod, both the main database and logs database. For this guide, we'll assume these files are called radarr.db and logs.db.
  6. Using pg_dump -s, dump the schema for the main Radarr database . P
with defaults: Some(Array [String("*")])
with multiple_outputs=true: Some(Array [String("logs"), String("metrics"), String("traces")])
with multiple_outputs=true, disable_traces=true: Some(Array [String("logs"), String("metrics")])
def find_nested_object_property_schema(schema, property_name)
@logger.debug "Starting search for nested property '#{property_name}'"
@logger.debug "Starting schema: #{JSON.dump(get_reduced_schema(schema))}"
# See if we're checking an object schema directly.
if !schema['properties'].nil?
@logger.debug "Schema is object, checking properties directly."
return schema['properties'][property_name]
end
@tobz
tobz / Dockerfile
Last active December 21, 2022 06:04
FROM ghcr.io/goauthentik/server:2022.9.0
USER root
RUN sed -i -e 's# > /dev/stderr##g' /lifecycle/ak
USER authentik
ENTRYPOINT ["/lifecycle/ak"]
CMD ["server"]
---
version: '3.4'
services:
postgresql:
image: docker.io/library/postgres:12-alpine
restart: unless-stopped
network_mode: host
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
{
"description": "A complete Vector configuration.",
"$ref": "#/definitions/vector::config::builder::ConfigBuilder",
"definitions": {
"vector::config::builder::ConfigBuilder": {
"description": "A complete Vector configuration.",
"allOf": [
{
"type": "object",
"properties": {
@tobz
tobz / datadog.yaml
Last active June 10, 2022 15:51 — forked from prognant/trace tool
apm_config:
# This points the `trace-agent` at Vector's `datadog_agent` source.
apm_dd_url: http://localhost:8081
# Set these to zero in order to avoid the Datadog Agent sampling traces before sending
# them to Vector, which will skew computed statistics like request count, or success vs
# error span count, etc.
max_traces_per_second: 0
errors_per_second: 0
// Our entrypoint for initializing logging via `tracing`.
pub fn initialize_logging(levels: &str) {
// Here, `levels` is "vector=info,codec=info,vrl=info,file_source=info,tower_limit=trace,rdkafka=info,buffers=info,kube=info".
let fmt_filter = tracing_subscriber::filter::Targets::from_str(levels).expect(
"logging filter targets were not formatted correctly or did not specify a valid level",
);
// `MetricsLayer` impls `tracing_subscriber::layer::Layer` so this ends up being `Option<Filtered<MetricsLayer, ...>>`.
let metrics_layer = metrics_layer_enabled()
.then(|| MetricsLayer::new().with_filter(tracing_subscriber::filter::LevelFilter::INFO));
/// A period of time.
#[derive(Clone, Serialize, Deserialize)]
pub struct SpecialDuration(u64);
/// Controls the batching behavior of events.
#[derive(Clone)]
#[configurable_component]
pub struct BatchConfig {
/// The maximum number of events in a batch before it is flushed.
max_events: Option<u64>,
#[configurable(type = "sink")]
pub struct BasicStruct {
foo: String,
}
const _: () = {
#[automatically_derived]
impl<'configurable> ::vector_config::Configurable<'configurable> for BasicStruct {
fn shape() -> ::vector_config::Shape {
::vector_config::Shape::Boolean
}